From 982d7e0b4e895e25020f2bd4b60303d2cb5ccc7a Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Fri, 8 Dec 2023 21:11:23 +0100 Subject: [PATCH 1/2] =?UTF-8?q?black=20=E2=86=92=20ruff=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rationale: - Use less tools, as we already use ruff. - While black has always been very opinionated, ruff does provide a few options. --- .pre-commit-config.yaml | 7 ++----- pyproject.toml | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e63408fcd..a8e89fa4d7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,17 +58,14 @@ repos: - -d - '{extends: relaxed, rules: {line-length: {max: 90}}}' - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 + rev: v0.1.7 hooks: - id: ruff + - id: ruff-format - repo: https://github.com/PyCQA/autoflake rev: v2.2.1 hooks: - id: autoflake - - repo: https://github.com/psf/black - rev: 23.11.0 - hooks: - - id: black - repo: https://github.com/codespell-project/codespell rev: v2.2.6 hooks: diff --git a/pyproject.toml b/pyproject.toml index 8fc19dc5df..723597bcb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,6 +109,21 @@ extend-ignore = [ "ANN101", "B904", "PLW2901", + # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules + "W191", + "E111", + "E114", + "E117", + "D206", + "D300", + "Q000", + "Q001", + "Q002", + "Q003", + "COM812", + "COM819", + "ISC001", + "ISC002", ] line-length = 88 select = [ From d4c90dbcf3d2fed810fb9e31c76548f06a46e36f Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Fri, 8 Dec 2023 21:17:22 +0100 Subject: [PATCH 2/2] Add pyupgrade rules to ruff --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 723597bcb0..15842fd0d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,6 +142,7 @@ select = [ "PLW", "S", "U", + "UP", "W", "YTT", ]