From 9c3047e1848522ed4908bb25e69a0411205acb70 Mon Sep 17 00:00:00 2001 From: Lasse Yledahl Date: Fri, 20 Sep 2024 11:30:26 +0000 Subject: [PATCH] move extended rules to post-format check --- Makefile | 2 ++ ruff-extended.toml | 6 ++++++ ruff.toml | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 ruff-extended.toml diff --git a/Makefile b/Makefile index fa3ae0783..32cb35be1 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ reformat: ruff check --select F401,I --fix # reformat ruff format + # make an extended check with rules that might be triggered by reformat + ruff check --config ruff-extended.toml lint: ruff check diff --git a/ruff-extended.toml b/ruff-extended.toml new file mode 100644 index 000000000..6cee5972f --- /dev/null +++ b/ruff-extended.toml @@ -0,0 +1,6 @@ +extend = "./ruff.toml" + +[lint] +# Some rules are marked as incompatible with the formatter so use them in an extended check instead. +# See: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules +extend-select = ["E501", "ISC"] diff --git a/ruff.toml b/ruff.toml index b25602e4d..62e6457b0 100644 --- a/ruff.toml +++ b/ruff.toml @@ -5,4 +5,4 @@ target-version = "py310" [lint] select = ["E", "F", "W", "I", "ASYNC", "UP", "FLY", "PERF", "FURB"] -ignore = [] +ignore = ["E501"]