-
-
Notifications
You must be signed in to change notification settings - Fork 18.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
Translate more banned import config to ruff #57283
Conversation
"pytest.xfail".msg = "Use pytest.mark.xfail instead of pytest.xfail" | ||
"conftest".msg = "No direct imports from conftest" | ||
"numpy.testing".msg = "Do not use numpy.testing" | ||
# "numpy.array_equal".msg = "Do not use numpy.array_equal" # Used in pandas/core |
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.
Could we just ignore it's usage in pandas/core?
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.
AFAIK, We can only ignore TID251
as a whole, we can't just ignore enforcing this rule for numpy.array_equal
in pandas/core
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.
Gotcha. Can we remove some of the old checks that are covered by this section?
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.
it's done in the latest commit, you can take a look.
02627df
to
07c9f0b
Compare
07c9f0b
to
e7b8912
Compare
Thanks @tqa236 |
* Translate more banned import config to ruff * Remove redundant rules
Translate some config in
unwanted-patterns-in-tests
toruff
. I think the main selling point ofruff
here is just the ease of implementing new rules, like the currently unenabledpytest.warns
one.The major difference is that
unwanted-patterns-in-tests
is currently only enabled inpandas/tests
while with this implementation,TID251
will be enabled globally.There are several approaches we can explore to reconcile the 2 behaviors.
pygrep
) for the restpandas
doesn't use it at the moment, so this will be a fairly big change)There's an open issue to track the progress of flat configuration, which allows us to keep all rules within 1 config file, but there's not much progress lately.