Skip to content

Commit

Permalink
Testing: Add pyupgrade linting; #6538
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rdimaio authored and bari12 committed Mar 21, 2024
1 parent a075668 commit 75569be
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pyproject.toml
Expand Up @@ -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"]
extend-safe-fixes = ["I001"]

0 comments on commit 75569be

Please sign in to comment.