From 381d1484763e969f024e22d7c0320a8560f8a50b Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:36:11 +0300 Subject: [PATCH 1/4] _parser.py no longer contains tabs --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e0e67e728490a1..36b8ff8bd7abc03 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,7 +47,6 @@ repos: hooks: - id: remove-tabs types: [python] - exclude: ^Tools/c-analyzer/cpython/_parser.py - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 From a03fb255140d944a20614b0406e495f570b1c7b0 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:36:41 +0300 Subject: [PATCH 2/4] prek autoupdate --jobs 0 --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 36b8ff8bd7abc03..7013663ef143ebc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.8 + rev: v0.13.2 hooks: - id: ruff name: Run Ruff (lint) on Doc/ @@ -36,7 +36,7 @@ repos: files: ^Tools/build/check_warnings.py - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.1.0 + rev: 25.9.0 hooks: - id: black name: Run Black on Tools/jit/ @@ -67,7 +67,7 @@ repos: files: '^\.github/CODEOWNERS|\.(gram)$' - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.33.2 + rev: 0.34.0 hooks: - id: check-dependabot - id: check-github-workflows @@ -79,7 +79,7 @@ repos: - id: actionlint - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.11.0 + rev: v1.14.1 hooks: - id: zizmor From 1efe015402591c4a781ab94d84a0e94fbef152c0 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:40:19 +0300 Subject: [PATCH 3/4] Don't ignore UP038, the rule has been removed and ignoring has no effect --- Tools/build/.ruff.toml | 1 - Tools/clinic/.ruff.toml | 3 --- Tools/peg_generator/.ruff.toml | 5 ----- 3 files changed, 9 deletions(-) diff --git a/Tools/build/.ruff.toml b/Tools/build/.ruff.toml index dcbf2936290f12f..996f725fdcb9b57 100644 --- a/Tools/build/.ruff.toml +++ b/Tools/build/.ruff.toml @@ -29,7 +29,6 @@ ignore = [ "F541", # f-string without any placeholders "PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple` "PYI025", # Use `from collections.abc import Set as AbstractSet` - "UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` ] [lint.per-file-ignores] diff --git a/Tools/clinic/.ruff.toml b/Tools/clinic/.ruff.toml index 5033887df0c1cda..944d17ee3e98551 100644 --- a/Tools/clinic/.ruff.toml +++ b/Tools/clinic/.ruff.toml @@ -17,9 +17,6 @@ ignore = [ # Use f-strings instead of format specifiers. # Doesn't always make code more readable. "UP032", - # Use PEP-604 unions rather than tuples for isinstance() checks. - # Makes code slower and more verbose. https://github.com/astral-sh/ruff/issues/7871. - "UP038", ] unfixable = [ # The autofixes sometimes do the wrong things for these; diff --git a/Tools/peg_generator/.ruff.toml b/Tools/peg_generator/.ruff.toml index d778cf0df9b49fc..bcf57248713df48 100644 --- a/Tools/peg_generator/.ruff.toml +++ b/Tools/peg_generator/.ruff.toml @@ -13,11 +13,6 @@ select = [ "RUF100", # Ban unused `# noqa` comments "PGH004", # Ban blanket `# noqa` comments (only ignore specific error codes) ] -ignore = [ - # Use PEP-604 unions rather than tuples for isinstance() checks. - # Makes code slower and more verbose. https://github.com/astral-sh/ruff/issues/7871. - "UP038", -] unfixable = [ # The autofixes sometimes do the wrong things for these; # it's better to have to manually look at the code and see how it needs fixing From d5d3e02715a1712172e74b9cfda62517213e49bd Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:44:21 +0300 Subject: [PATCH 4/4] Rename legacy 'ruff' ID to 'ruff-check' --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7013663ef143ebc..014dab1d2b58bea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,27 +2,27 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.13.2 hooks: - - id: ruff + - id: ruff-check name: Run Ruff (lint) on Doc/ args: [--exit-non-zero-on-fix] files: ^Doc/ - - id: ruff + - id: ruff-check name: Run Ruff (lint) on Lib/test/ args: [--exit-non-zero-on-fix] files: ^Lib/test/ - - id: ruff + - id: ruff-check name: Run Ruff (lint) on Tools/build/ args: [--exit-non-zero-on-fix, --config=Tools/build/.ruff.toml] files: ^Tools/build/ - - id: ruff + - id: ruff-check name: Run Ruff (lint) on Tools/i18n/ args: [--exit-non-zero-on-fix, --config=Tools/i18n/.ruff.toml] files: ^Tools/i18n/ - - id: ruff + - id: ruff-check name: Run Ruff (lint) on Argument Clinic args: [--exit-non-zero-on-fix, --config=Tools/clinic/.ruff.toml] files: ^Tools/clinic/|Lib/test/test_clinic.py - - id: ruff + - id: ruff-check name: Run Ruff (lint) on Tools/peg_generator/ args: [--exit-non-zero-on-fix, --config=Tools/peg_generator/.ruff.toml] files: ^Tools/peg_generator/