`--filter-files` does not consider extensions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7k
- Forks
- 687
- Avg merge
- 4h 56m
- Merged PRs (30d)
- 2
Description
To reproduce:
$ mkdir -p folder
$ echo -e 'import unknown\nimport sys' > folder/file.py
$ isort folder --check -v
ERROR: folder/file.py Imports are incorrectly sorted and/or formatted.
Try filtering files with --gitignore and --filter-files - works fine.
$ echo '*.py' > folder/.gitignore
$ isort folder --check --gitignore
Skipped 1 files
$ isort folder/file.py --check --gitignore
ERROR: folder/file.py Imports are incorrectly sorted and/or formatted.
$ isort folder/file.py --check --gitignore --filter-files
Skipped 1 files
Try filtering files with --ext and --filter-files - works fine.
$ isort folder --check
ERROR: folder/file.py Imports are incorrectly sorted and/or formatted.
$ isort folder/file.py --check --ext txt
ERROR: folder/file.py Imports are incorrectly sorted and/or formatted.
$ isort folder/file.py --check --ext txt --filter-files
ERROR: folder/file.py Imports are incorrectly sorted and/or formatted.
I expected isort folder/file.py --check --ext txt --filter-files to have no filtered out the folder/file.py
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the isort CLI handling for --filter-files, --ext, and --gitignore, then run the reproduction commands from the issue to compare their filtering behavior. Done means a file whose extension is excluded by --ext is skipped when --filter-files is used, while the existing gitignore behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100