Skip to content

Commit

Permalink
enable pyupgrade linter
Browse files Browse the repository at this point in the history
The main rule we're interested in is UP035, which helps prevent using
deprecated imports. Specifically some of the `typing` imports which now
live in `collections.abc`.

I disabled two rules which consider some optional args as unnecessary,
as there were many occurrences and it seemed opinionated.

Signed-off-by: Spencer Schrock <sschrock@google.com>
  • Loading branch information
spencerschrock committed Aug 21, 2024
1 parent e18b1d5 commit a9d6941
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,13 @@ line-ending = "lf"
skip-magic-trailing-comma = true

[tool.ruff.lint]
select = ["B", "D", "E", "F", "I", "N", "PLC", "PLE", "PT", "SIM", "W"]
# TODO: selectively enable back most of these in subsequent PRs
ignore = ["B024", "D100", "D101", "D102", "D103", "D104", "D105", "D107", "D417"]
select = ["B", "D", "E", "F", "I", "N", "PLC", "PLE", "PT", "SIM", "UP", "W"]
ignore = [
# TODO: selectively enable back most of these in subsequent PRs
"B024", "D100", "D101", "D102", "D103", "D104", "D105", "D107", "D417",
# Unnecessary arguments can help with clarity
"UP012", "UP015"
]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
Expand Down

0 comments on commit a9d6941

Please sign in to comment.