-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
coreRelated to core functionalityRelated to core functionality
Description
I don't think --force-exclude does what it should; this is especially obvious when using pre-commit-ruff (which is supposed to be used with that flag).
In a repository where there are no excludes, or extend-excludes, running ruff --force-exclude . claims there are no Python files. AFAIU this shouldn't happen since nothing is excluded. This happens with --isolated too.
~/b/ruff-force-exclude-test $ ruff --force-exclude --isolated foo/a.py
warning: No Python files found under the given path(s)
~/b/ruff-force-exclude-test $ ruff --isolated foo/a.py
foo/a.py:1:8: F401 `time` imported but unused
Found 1 error(s).
1 potentially fixable with the --fix option.
~/b/ruff-force-exclude-test $- A minimal code snippet that reproduces the bug:
- The command you invoked (e.g.,
ruff /path/to/file.py --fix), ideally including the--isolatedflag:ruff --force-exclude --isolated foo/a.py(or without--isolated)
- The current Ruff settings (any relevant sections from your
pyproject.toml):-
[tool.ruff] target-version = "py37" select = ["F401"]
-
- The current Ruff version (
ruff --version):ruff 0.0.227(versions before 0.0.204 don't show the warning, but they also don't do anything).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreRelated to core functionalityRelated to core functionality