mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Move Ruff unsafe-fixes from pre-commit to config (#11783)
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user