Repository navigation
Conversation
SemTiOne
force-pushed
the
issue/1970
branch
from
September 26, 2026 12:36
5b2956f to
2c705c1
Compare
SemTiOne
force-pushed
the
issue/1970
branch
from
September 26, 2026 12:47
2c705c1 to
81e2779
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2676 +/- ##
=======================================
Coverage 99.44% 99.45%
=======================================
Files 41 41
Lines 3225 3275 +50
Branches 692 702 +10
=======================================
+ Hits 3207 3257 +50
Misses 11 11
Partials 7 7 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Early insertion can bypass opt-out directives and still place future imports after non-docstring string expressions.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Fixes future-import placement in append_only mode to avoid invalid late imports.
Changes:
- Detects future additions and inserts them before executable code.
- Preserves import-free and frozen-content files.
- Adds regression coverage for issue #1970.
| File | Description |
|---|---|
isort/core.py |
Implements early future-import placement. |
tests/unit/test_regressions.py |
Adds append-only regression tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.


In
append_onlymode, added future imports landed in a later import section, producing a SyntaxError. They now take the early insertion path so they precede all code; files without imports stay untouched, and additions are skipped when frozen executable content precedes placement.Closes #1970.