-
Notifications
You must be signed in to change notification settings - Fork 89
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
chore: move to Ruff #2153
chore: move to Ruff #2153
Conversation
"docs-*", | ||
"src/awkward/_typeparser/generated_parser.py", | ||
] | ||
ignore = ["E501", "C408", "E713", "E714", "UP030"] |
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.
Several of these eventually should be not skipped.
Codecov Report
Additional details and impacted files
|
Signed-off-by: Henry Schreiner <[email protected]>
bc132af
to
8efd607
Compare
@jpivarski I'm happy with this, merge if you are too :) |
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.
I just tried it out, both with pre-commit and directly. The direct invocation found a not-real issue (UP003) because it doesn't know about some_llvmite_type
in expressions like some_llvmlite_type.type(0)
; it's thinking we're doing the free function type(0)
, which for a constant like 0
, would be just int
.
I added noqa
in case someone else runs into this.
Okay, I guess I should report this to the ruff developers. Nope! It's already done: astral-sh/ruff#1958
There's a commit test that will remove the noqa
when it's no longer needed. I'm going to remove the text of the comment other than the bare noqa
so that it will be removed cleanly. (noqa
removal tries to preserve the rest of the commit message, which will become nonsensical when the noqa
is gone...)
For me, this reduces the time spent in pre-commit from about 12 seconds to 6.6 seconds. Ruff takes <1 second to process the entire codebase, and can do the work of several tools. I think "check YAML" is now the slowest check. :)
It has several checks that look very useful, and autofix is amazing, but this is a very minimal conversion to start with.
This should also stop the failures caused by plugins updating, since everything is one versioned binary.