notifications-admin icon indicating copy to clipboard operation
notifications-admin copied to clipboard

Enable Pyupgrade linting rules

Open quis opened this issue 9 months ago • 0 comments

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


  1. https://pypi.org/project/pyupgrade/
  2. https://docs.astral.sh/ruff/rules/#pyupgrade-up

quis avatar May 07 '24 16:05 quis