Add pyupgrade linter

This ensures we use the best syntax for the minimal Python version used.
The linter found one issue, fixed with the auto-fixer.
This commit is contained in:
Martijn Pieters
2023-05-16 12:46:20 +01:00
parent daad4cf9a8
commit f7db5cceb1
2 changed files with 2 additions and 1 deletions

View File

@@ -52,7 +52,7 @@ def object_hook(obj: Any) -> Any:
if _spec_type in CONVERTERS:
return CONVERTERS[_spec_type](obj["val"])
else:
raise TypeError("Unknown {}".format(_spec_type))
raise TypeError(f"Unknown {_spec_type}")
class Coder:

View File

@@ -86,6 +86,7 @@ select = [
"F", # pyflakes
"I", # isort
"W", # pycodestyle warnings
"UP", # pyupgrade
]
target-version = "py37"