From a1c7926e62c889f1a01acee8515cd5f44a952fb5 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 9 Apr 2024 14:07:12 -0400 Subject: [PATCH] Re-order ruff runs in pre-commit (#11737) Co-authored-by: Alex Waygood --- .pre-commit-config.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index caab9ddcd..584f91c3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,19 +13,24 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.3.5 # must match requirements-tests.txt hooks: - - id: ruff - name: Run ruff on stubs, tests and scripts - args: ["--exit-non-zero-on-fix"] - id: ruff # Run this separately because we don't really want # to use --unsafe-fixes for all rules + # Should be run first as it can leave unused imports behind name: Remove unnecessary `sys.version_info` blocks args: ["--exit-non-zero-on-fix", "--select=UP036", "--unsafe-fixes"] + - id: ruff + name: Run ruff on stubs, tests and scripts + args: ["--exit-non-zero-on-fix"] - id: ruff # Very few rules are useful to run on our test cases; # we explicitly enumerate them here: name: Run ruff on the test cases - args: ["--exit-non-zero-on-fix", "--select=FA,I,RUF100", "--no-force-exclude", "--unsafe-fixes"] + args: + - "--exit-non-zero-on-fix" + - "--select=FA,I,RUF100" + - "--no-force-exclude" + - "--unsafe-fixes" files: '.*test_cases/.+\.py$' - repo: https://github.com/psf/black-pre-commit-mirror rev: 24.3.0 # must match requirements-tests.txt