Repository navigation
Sort template-written imports with their comments like isort - #6677
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merging this PR will degrade performance by 15.5%1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Breaking Change AnalysisResult: No breaking changes detected Reasoning: The PR only changes the private module _builtin_formatter.py plus its tests and one expected-output fixture. It makes the built-in formatter match isort and black more closely. Comments directly above an import in the module import block now move with that import, and other comments between imports move below the block where they used to be lost. Import runs at module level after the first statement are now sorted, as isort already does for nested bodies. A compound line such as an import followed by a semicolon and another statement now keeps that second statement instead of silently dropping it, which is what the changed fixture shows. All signature changes are on private underscore helpers such as _BlankLinePlacer, _iter_aliased_from_import_lines and _build_builtin_import_block, whose new keyword argument is optional and defaults to the old behaviour. No public CLI option, Python API, template variable or supported Python version is added, removed or changed. Every behaviour diff gate cell is classed both-fail, with no accepted or violation cells, so default generated output is unchanged. Any remaining output differences only affect unusual input such as custom templates with comments between imports, and they fix lost comments or code rather than break existing users. This analysis was produced by the release draft workflow |
|
🎉 Released in 0.93.0 This PR is now available in the latest release. See the release notes for details. |
Fixes: #6668
Summary by CodeRabbit