Repository navigation
Conversation
…sort (PyCQA#1972) Signed-off-by: Yshuro <yshuro1080@gmail.com>
Yshuro
force-pushed
the
fix/force-alphabetical-sort-lines-between-types
branch
from
November 19, 2026 18:35
ee8905b to
41f5bfb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2797 +/- ##
=======================================
Coverage 99.39% 99.39%
=======================================
Files 40 40
Lines 3317 3318 +1
Branches 716 717 +1
=======================================
+ Hits 3297 3298 +1
Misses 12 12
Partials 8 8 🚀 New features to boost your workflow:
|
Signed-off-by: Yshuro <yshuro1080@gmail.com>
This branch has not been deployed
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.
Summary
Fixes #1972 where configuring
--force-alphabetical-sortunconditionally forcedlines_between_types = 1, overriding any user configuration settinglines_between_types = 0(or other values) via config files or CLI flags.Changes
isort/settings.py: In_Config.__post_init__, only setlines_between_types = 1as a default whenlines_between_typeswas not explicitly provided in any non-default configuration source (self.sources[1:]).isort/main.py: Updateparse_argsdictionary comprehension so integer CLI arguments equal to0(such as--lines-between-types 0/--lbt 0) are not dropped by the truthiness check.tests/unit/test_isort.pyverifying defaultforce_alphabetical_sortbehavior,lines_between_types=0, and custom values.tests/unit/test_main.pyverifying--lines-between-types 0and--lbt 0parsing.Closes #1972