Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
Add pyupgrade to pre-commit hooks#9682
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Yes, I considered adding pyupgrade to do my previous PR, but consciously chose not to as I thought it would introduce more churn than what I was aiming for, but to be honest I was expecting a bigger diff than that. I assume that disabling percent-formt to f-string is helping a lot.
It could indeed help us cleanup old branches from#9681 as the project drops support for old versions, so might pay off in the long run |
ulgens commentedApr 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@browniebroke Removing the I wanted to go with minimal changes to be safer but we can use it without excluding any rules. |
Yes I agree, that makes sense to keep changes to a minimum 👍 |
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.
looks good
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.
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
ea1da76
intoencode:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Description
Inspired from@browniebroke 'sPR We can and we should automate this type of checks.
pyupgrade
is a great tool to do that and we already hadpre-commit
setup in place.I tried to minimize the changes by excluding
%s
to f-string conversions but it looks like the code was a bit neglected so the resulting changes are still not so small.This looks like nitpicking and "churn", but in my experience,
pyupgrade
anddjango-upgrade
helps a lot to minimize the maintenance efforts.