Add pyupgrade to pre-commit hooks#9682
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 |
|
@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 👍 |
Description
Inspired from @browniebroke 's PR We can and we should automate this type of checks.
pyupgradeis a great tool to do that and we already hadpre-commitsetup in place.I tried to minimize the changes by excluding
%sto 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,
pyupgradeanddjango-upgradehelps a lot to minimize the maintenance efforts.