From 5ec974ff94b87b7012bff5ef898f55da7f647cde Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 28 Oct 2025 18:01:54 +0500 Subject: [PATCH] Exclude build-all.py from main ruff check --- .github/workflows/ci-black-formatting.yaml | 10 ++++++---- nix/build-all.py | 2 -- pyproject.toml | 11 +++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-black-formatting.yaml b/.github/workflows/ci-black-formatting.yaml index 333bd098e8..820a81dc97 100644 --- a/.github/workflows/ci-black-formatting.yaml +++ b/.github/workflows/ci-black-formatting.yaml @@ -26,6 +26,7 @@ jobs: curl -LsSf https://astral.sh/uv/install.sh | sh uv tool install ruff uv tool install black + uv tool install poethepoet # black doesn't catch all syntax errors, so we check them explicitly. - name: Check syntax errors @@ -40,15 +41,16 @@ jobs: - name: Black formatter id: black run: | - uvx black --diff --check . + black --diff --check . continue-on-error: true - name: Ruff check id: ruff run: | - uvx ruff check - # It's actually Python 3.6, but ruff only supports 3.7+, but it should do. - uvx ruff check nix/build-all.py --target-version py37 + ERROR=0 + poe ruff-main || ERROR=1 + poe ruff-old || ERROR=1 + exit $ERROR continue-on-error: true - name: Final check diff --git a/nix/build-all.py b/nix/build-all.py index e54c842456..9fda4f9513 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -18,8 +18,6 @@ # # ############################################################################### -# ruff: noqa: UP035 - """ Example usage: # Build all targets by default. diff --git a/pyproject.toml b/pyproject.toml index b8257416ae..c03921c762 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,3 +62,14 @@ ignore = [ "UP031", # Replace % with .format "UP032", # Replace .format with f-string ] + +[tool.poe.tasks] + +ruff-main = "ruff check --extend-exclude nix/build-all.py" +# It's actually Python 3.6, but ruff only supports 3.7+, but it should do. +ruff-old = "ruff check nix/build-all.py --target-version py37" +ruff.sequence = ["ruff-main", "ruff-old"] + +black = "black ." + +format.sequence = ["black", "ruff-main", "ruff-old"]