Repository navigation
Keep comments between statements and place black's blank lines - #6675
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 33.6%2 warnings
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: This PR only changes the builtin formatter in _builtin_formatter.py. It replaces the old ad hoc blank-line handling for class bodies, nested import runs and the area before the import block with a port of black's EmptyLineTracker, called _BlankLinePlacer. With it, comments between statements are kept in the right block and black's blank lines go around them. The removed functions, _leading_lines_before_imports and the old _import_runs signature, are private helpers; the only other removal is the private name in the watch list in format.py. No CLI option, public Python API, template variable or supported Python version changes. The expected-output changes are whitespace only, in builtin-formatter runs that use custom templates with unusual blank lines or comments. The builtin output now matches what black produces, so several builtin and external fixtures that used to differ are now mapped as equal. That is a consistency fix, not a regression. The behaviour diff gate has no accepted or violation cells for default options. Every differing cell is crash-fix or both-fail, so default generated output is unchanged. Error handling is not changed. 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: #6667
Fixes: #6669
Summary by CodeRabbit