From 75569be00df32d8593a02ac56cedd0e1416f900d Mon Sep 17 00:00:00 2001 From: rdimaio Date: Mon, 18 Mar 2024 17:47:29 +0100 Subject: [PATCH] Testing: Add pyupgrade linting; #6538 Pyupgrade is a linter to check for deprecated Python syntax. This commit configures ruff to perform pyupgrade linting. In the ignore list, I added some pyupgrade error codes (UP*) for the moment. These must either be fixed manually, or might be controversial in some way, so we can consider them at a later point. --- pyproject.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8d58511e99..3d7069bd4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,12 +38,19 @@ exclude = [ [tool.ruff.lint] select = [ "I", # isort + "UP", # pyupgrade ] ignore = [ "ALL", + "UP008", # Use `super()` instead of `super(__class__, self)` + "UP015", # Unnecessary open mode parameters + "UP027", # Replace unpacked list comprehension with a generator expression + "UP028", # Replace `yield` over `for` loop with `yield from` + "UP030", # Use implicit references for positional format fields "UP031", # Use format specifiers instead of percent format + "UP032", # Use f-string instead of `format` call "SIM210", ] -extend-safe-fixes = ["I001"] \ No newline at end of file +extend-safe-fixes = ["I001"]