-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Enable nearly all pyupgrade rules (except on test cases) #11499
Enable nearly all pyupgrade rules (except on test cases) #11499
Conversation
This comment has been minimized.
This comment has been minimized.
…Avasam/typeshed into less-selective-pyupgrades-rules
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…Avasam/typeshed into less-selective-pyupgrades-rules
Please also ignore UP038 everywhere due to astral-sh/ruff#7871. It doesn't matter for us now, since it only triggers if the target version is set to py310 or higher, but I don't want a nasty pre-commit surprise when we drop support for Python 3.9 :) |
This comment has been minimized.
This comment has been minimized.
This reverts commit 170653f.
Forgot about that one, I even have it in my own personal projects' ignore |
This comment has been minimized.
This comment has been minimized.
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!
Co-authored-by: Alex Waygood <[email protected]>
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Co-authored-by: Alex Waygood <[email protected]>
There's more rules that we want than rules we don't want. And with Ruff having a distinction for "unsafe fixes" (not applied by default) the comment "Only enable rules that have safe autofixes" holds less weight.
Rules relevant to code changes:
https://docs.astral.sh/ruff/rules/lru-cache-without-parameters/
https://docs.astral.sh/ruff/rules/f-string/
Even the protobuf-specific ignore could be activated and autofixes run, as they have a redundant (for typeshed at least) Python >= 3.8 check.
Extracted from #11496 , overlaps with #11498
xref plinss/flake8-noqa#22 as with it there would be 1 less noqa