-
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
INP001
: Skip scripts, for example Python files with shebang
#8690
Comments
Work-around for [tool.ruff.per-file-ignores]
"[!s][!r][!c]*/**" = ["INP001"] |
I thought (2) was already respected to some degree -- we skip files that are direct children of the project root, and of any of the declared |
Do you mean skipped when traversing a root target directory? A CI tool/Git hook may specify a Python file path explicitly. |
I mean if you have a source set, like: [tool.ruff]
src = ["src", ".gitlab-ci"] Then any files that are direct children of those directories get skipped. |
We could ignore files with shebangs though. |
## Summary I think it's reasonable to avoid raising `INP001` for scripts, and shebangs are one sufficient way to detect scripts. Closes #8690.
A Python script isn't meant to be imported as a package, and so INP001 is not applicable.
There are multiple criteria that each imply a file is a script, in particular in combination:
src
directory (only necessary and sufficient if you stick to the src-layout, perhaps).ruff 0.1.5.
The text was updated successfully, but these errors were encountered: