Move Ruff unsafe-fixes from pre-commit to config (#11783)

This commit is contained in:
Avasam
2024-04-18 13:44:51 -04:00
committed by GitHub
parent ec2430a42b
commit d26f125160
2 changed files with 3 additions and 6 deletions

View File

@@ -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"]

View File

@@ -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)