Add the "UP" (pyupgrade) ruff rules#282
Merged
seddonym merged 2 commits intopython-grimp:mainfrom Dec 17, 2025
Merged
Conversation
As version of Python get dropped (like Python 3.9 recently), it's good to keep on top of opportunities for syntax changes/modernization. This Ruff rule is an easy to way to do this. My ulterior motive is to get more Ruff rulesets enabled in the codebase, gradually.
| line-length = 99 | ||
| exclude = ['tests/assets'] # These are sample packages for tests to run under - we don't want ruff to mess with them. | ||
| [tool.ruff.lint] | ||
| select = ["E4", "E7", "E9", "F", "UP"] |
Contributor
Author
There was a problem hiding this comment.
These other rules are the defaults
CodSpeed Performance ReportMerging #282 will not alter performanceComparing Summary
Footnotes
|
seddonym
approved these changes
Dec 17, 2025
Collaborator
seddonym
left a comment
There was a problem hiding this comment.
Love it.
My ulterior motive is to get more Ruff rulesets enabled in the codebase, gradually. To some extent, I'm just testing the waters here about your appetite for this :)
100% on board!
Is there a need for a changelog entry here? I feel it's a bit excessive.
I agree, it's only important for user-facing changes IMO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[ ] Add tests for the change. In general, aim for full test coverage at the Python level. Rust tests are optional.
[ ] Add any appropriate documentation.
[] Add a summary of changes to
CHANGELOG.rst.[ ] Add your name to
AUTHORS.rst.[] Run
just full-check.As versions of Python get dropped (like Python 3.9 recently), it's good to keep on top of opportunities for syntax changes/modernization. This Ruff rule is an easy to way to do this.
My ulterior motive is to get more Ruff rulesets enabled in the codebase, gradually. To some extent, I'm just testing the waters here about your appetite for this :)
Is there a need for a changelog entry here? I feel it's a bit excessive.