-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
per-file-ignores
with ALL creates a false positive
#9297
Comments
I'm trying to exclude files from linting but not formatting, without editing those files. |
Seems like a bug as-described, will take a look. |
We also support a dedicated exclude keyword under the lint namespace which will only exclude files from linting and is the preferred solution for what you’re describing, e.g.: [lint]
exclude = ["file.py"] |
Didn't realize it was under lint namespace! Thank you. |
Regardless, it is a bug so fixed in the next release :) Thanks! |
## Summary If `RUF100` is ignored via `per-file-ignores`, we need to avoid raising it. `RUF100` has special "self-ignore" logic, since the rule itself deals with `# noqa` directives. This PR wires up `per-file-ignores` to that "self-ignore" logic. Closes #9297.
Given the following Python file
and the following Ruff configuration
ruff check
will still raise errorRUF100 [*] Unused `noqa` directive (unused: `T201`)
.The text was updated successfully, but these errors were encountered: