Fix edge case of __future__ import.#2458
Merged
DanielNoord merged 5 commits intoPyCQA:mainfrom Feb 16, 2026
Merged
Conversation
skv0zsneg
commented
Feb 16, 2026
| config.lines_between_types if from_modules and straight_modules else 0 | ||
| ) | ||
| if config.from_first: | ||
| if config.from_first or section == "FUTURE": |
Contributor
Author
There was a problem hiding this comment.
The deepsource checks warns me of cyclomatic complexity here but I got only one small change. Do I need to split the logic for decrease complexity?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2458 +/- ##
=======================================
Coverage 99.24% 99.24%
=======================================
Files 39 39
Lines 3057 3057
Branches 675 675
=======================================
Hits 3034 3034
Misses 13 13
Partials 10 10 🚀 New features to boost your workflow:
|
DanielNoord
reviewed
Feb 16, 2026
Member
DanielNoord
left a comment
There was a problem hiding this comment.
Just add an ignore for the warning :)
DanielNoord
approved these changes
Feb 16, 2026
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.
Fixing #1882
Every
FUTUREsection now have the "fromfirst" rule by default to avoid exception below: