Repository navigation
Respect extension filters for explicit files with --filter-files - #2720
Merged
DanielNoord merged 1 commit intoOct 15, 2026
Merged
Conversation
DanielNoord
requested changes
Oct 15, 2026
DanielNoord
left a comment
Member
There was a problem hiding this comment.
Please check if it doens't make more sense to merge is_skipped and is_supported_filetype. Not sure why that is not just a single function.
Contributor
Author
|
I checked this to see if we could consolidate them into
If you'd like to encapsulate the combined check so |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2720 +/- ##
=======================================
Coverage 99.38% 99.38%
=======================================
Files 41 41
Lines 3230 3231 +1
Branches 690 690
=======================================
+ Hits 3210 3211 +1
Misses 12 12
Partials 8 8 🚀 New features to boost your workflow:
|
DanielNoord
approved these changes
Oct 15, 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.
Fixes #1984.
With
--filter-files, an explicitly supplied file bypassed the extension filter used for directory discovery. For example,isort file.txt --filter-filesrewrote a.txtfile under the default Python-only configuration, andisort file.py --ext txt --filter-files --check-onlyreported an error instead of skipping the file.Apply the existing
Config.is_supported_filetypecheck to regular files in the CLI's explicit-path filter. Directory arguments still reach discovery, missing paths still reach the existing broken-path handling, and explicit files without--filter-filesretain their override behavior.Validation on macOS / CPython 3.12.11, with the frozen development dependencies:
92c56855437785000527b70c1476d1ab75dd78fd; all eight pass after the fix.--filter-files.main.pyhas no partially covered branches.git diff --checkpasses.The initial unit run used a global
isortexecutable in two subprocess tests; the complete suite was rerun successfully with the local environment on PATH. Thetox -e lintwrapper was stopped after dependency setup and the start of mypy; the same lint commands were then completed directly. Other Python versions, platforms, compiled builds, and the separate integration/property and downstream-project suites were not run locally.AI disclosure: OpenAI Codex assisted with investigation, implementation, regression tests, and the local checks reported above.