-
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
New rule category XP
, implement not-array-agnostic-numpy
(XP001
)
#8910
Conversation
crates/ruff_linter/src/rules/xp/rules/not_array_agnostic_numpy.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/xp/rules/not_array_agnostic_numpy.rs
Outdated
Show resolved
Hide resolved
Hey @charliermarsh, here's where I'm at currently. I've included the raw naming differences as replacements so far. To-do:
Are these things possible?
|
Thank you @lucascolley for this rule proposal and implementation. I really like the idea of it. I think such a rule would be very helpful for our users. Unfortunately, Ruff doesn't have a good concept today for very opinionated rules or rules that intentionally restrict the allowed APIs. Ruff also lacks a good default rule set, and, unfortunately, many users assume that I'm sorry that it took us so long to give that feedback to you, and I hope we can get this rule landed once #1774 is completed. Thanks again. |
Thanks for the reply @MichaReiser , no worries! Happy to return to this once gh-1774 is resolved. I agree that this should be explicitly opt-in at all times.
Does that include |
It does include preview rules when running ruff with |
Summary
Closes gh-8615
XP
NotArrayAgnosticNumPy
Aiming for violations for all non-standard NumPy functions and methods and uses of them. Some of these will have standard aliases or alternatives. We should try to catch as many of the 'compatible' and 'strictness' changes of https://numpy.org/doc/stable/reference/array_api.html as possible (the 'breaking' changes should be caught separately - by
NP201
or perhapsNP202
is also needed).Test Plan
WIP