From a9d69416e4f9452be443dc21db50bcbae931fd4c Mon Sep 17 00:00:00 2001 From: Spencer Schrock Date: Tue, 20 Aug 2024 10:29:34 -0700 Subject: [PATCH] enable pyupgrade linter 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 --- pyproject.toml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c1bf609c..088026b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"