-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Extend ruff to use more checkers #3594
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
Conversation
and fix what ruff found
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.
Hey! Looks like you edited the (optional) requirements or the pre-commit hooks. I'm just a friendly reminder to keep the additional dependencies for the hooks in sync with the requirements :)
Bibo-Joshi
left a comment
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.
Thanks for the PR!
Regarding the several changed comparisons: I guess that ruff doesn't like hardcoded values there. However, I see no value of something like
const = 5
if something == const:
...especially if the comparison is part of a function. The definition of const should at the very least be moved outside of the function definition to avoid defining it on every run.
I don't really like it either.. do you want to ignore it? |
Bibo-Joshi
left a comment
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.
Soooo many changes in the tests 😮
Makes ruff use more checkers, so we can now remove pyupgrade and isort from pre-commit hooks.
New checkers used:
isort
pylint
pyupgrade
ruff's checkers
flake8-use-pathlib
flake8-bugbear
flake8-comprehensions
flake8-pie
flake8-pytest-style
flake8-return
flake8-simplify
flake8-raise
flake8-logging-format
flake8-implicit-str-concat
TODO: Remove the ruff noqa line from test_official after api 6.6 is merged