-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Use ruff to detect banned import #57184
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
Use ruff to detect banned import #57184
Conversation
6fc664e
to
bb8bc8f
Compare
.pre-commit-config.yaml
Outdated
@@ -30,6 +30,10 @@ repos: | |||
files: ^pandas | |||
exclude: ^pandas/tests | |||
args: [--select, "ANN001,ANN2", --fix-only, --exit-non-zero-on-fix] | |||
- id: ruff | |||
args: [--exit-non-zero-on-fix, --select=TID251] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cant we just add TID251
to the pyproject.toml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke indeed all the TID
rules are already enabled. This new hook is redundant because the first ruff
hook can cover it already.
Do you think I need to ignore TID251
in pandas/tests/*
? If not, this PR should be ready for review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TID251
shouldn't be ignored for tests
Thanks @tqa236 |
* Use ruff to detect banned import * Combine rules
There are several other potential replacement, I just open this PR first to check if this replacement is good or not. The newly added
noqa
inpandas/io/common.py
shows that the check works.doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.