-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make ruff much stricter #425
Conversation
3e1fba0
to
a6b12cd
Compare
98102f3
to
ac3999a
Compare
Enable ALL checks, then list + classify individual checks (or in some cases, groups of checks) to be ignored. Most of these ignored checks will be tackled and re-enabled in the next commits. Finally, for individual instances of intentional check violations (or false positives), add "noqa: ..." annotations to the code in question. Some of these coincide with existing pylint annotations.
Fixes the most widespread violation of Ruff's N818 warning: "Exception name `...` should be named with an Error suffix".
ac3999a
to
17eae72
Compare
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 really like how you logically structured the problem making ruff strict - each commit tackling a different type of error.
I think we should avoid # noqa
comment as much as possible, or explain why we use it, but this can be a subject of another PR.
🚀
Thanks! 🙏🏻
Agreed. My philosophy here is roughly this:
With these pytlint -> ruff PRs, we've gone from ~30 An important goal is of course to minimize the number of |
Re-configure
ruff
to enable as many checks as feasible, and fix various issues throughout our codebase. The second PR in a series of 3.Commits:
ruff
to be much stricterset(<generator>)
->{<set comprehension>}
assert False
->pytest.fail(...)
@pytest.mark.parametrize
.keys()
str()
set([...])
->{...}
.get()
if-else
block@pytest.fixture()
over@pytest.fixture
_
in parametrized argsPath.*
methods where availableyield from
instead offor
-loop withyield
insideif
-conditions[foo, *bars]
instead of[foo] + bars
elif
instead ofelse
+if
where possiblebool
flag arguments to functions are always namedUnparseablePathException
->UnparseablePathError
Path()