notifications-admin
notifications-admin copied to clipboard
Enable Pyupgrade linting rules
Pyupgrade1 automatically upgrades syntax for newer versions of Python. Newer syntax is often friendlier and less verbose – for example f-string formatting rather than calls to str.format
.
It has a total of 42 rules2.
This commit adds it to our linter config, and then fixes all the instances of old syntax it found (the vast majority of these were automatic by running Ruff with the --fix
flag).
Should stay in draft until https://github.com/alphagov/notifications-utils/pull/1118 is merged and we can remove pyproject.toml
from this repo
- https://pypi.org/project/pyupgrade/
- https://docs.astral.sh/ruff/rules/#pyupgrade-up