From d26f1251600d3eea24fcc035742a665249958fb1 Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 18 Apr 2024 13:44:51 -0400 Subject: [PATCH] Move Ruff unsafe-fixes from pre-commit to config (#11783) --- .pre-commit-config.yaml | 6 ------ pyproject.toml | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa76bc15e..ba361da9d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,12 +13,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.3.7 # must match requirements-tests.txt hooks: - - 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"] diff --git a/pyproject.toml b/pyproject.toml index 068f203af..5d27e0bbd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,9 @@ select = [ "PYI055", # multiple `type[T]` usages in a union "PYI058", # use `Iterator` as the return type for `__iter__` methods ] +extend-safe-fixes = [ + "UP036", # Remove unnecessary `sys.version_info` blocks +] ignore = [ ### # Rules that can conflict with the formatter (Black)