Avoid leading newline with float-to-top#2583
Open
sakshichitnis27 wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2583 +/- ##
=======================================
Coverage 99.39% 99.39%
=======================================
Files 41 41
Lines 3137 3137
Branches 680 680
=======================================
Hits 3118 3118
Misses 11 11
Partials 8 8 🚀 New features to boost your workflow:
|
DanielNoord
reviewed
Jul 16, 2026
DanielNoord
left a comment
Member
There was a problem hiding this comment.
Thanks for the fix!
It works, but I don't think this is how we'd like to solve this. I'd expect the fix to actually be in sorted_imports instead of overwriting a configuration value on the fly. That could have unintended side effects. Do you think you can fix this without doing this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1935
Summary
lines_before_importsduring the preliminaryfloat_to_toppass.Testing
lines_before_imports = 1andfloat_to_top = true.pytest -q— 621 passed, 2 skippedpytest -q tests/unit/test_regressions.py -k "float_to_top or lines_before_imports"ruff check isort/core.py tests/unit/test_regressions.pymypy isort/core.py tests/unit/test_regressions.pyflake8 isort/core.py tests/unit/test_regressions.pyisort --check-only isort/core.py tests/unit/test_regressions.py