From 3e5e922da8dc58eb4b18c04f893f731b218dded9 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 26 May 2025 18:11:39 +0300 Subject: [PATCH 1/3] Add CODEOWNERS to end-of-file-fixer and trailing-whitespace --- .pre-commit-config.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3632cf392039f5..2f65fa13cc4e46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,10 +45,12 @@ repos: - id: end-of-file-fixer types: [python] exclude: Lib/test/tokenizedata/coding20731.py + - id: end-of-file-fixer + files: ^\.github/CODEOWNERS - id: trailing-whitespace types_or: [c, inc, python, rst] - id: trailing-whitespace - files: '\.(gram)$' + files: '^\.github/CODEOWNERS|\.(gram)$' - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.33.0 From 4f77bd7a9715b343cce0503a7a64e48f552ff1ed Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 26 May 2025 18:12:00 +0300 Subject: [PATCH 2/3] Add yaml to end-of-file-fixer and trailing-whitespace --- .github/workflows/tail-call.yml | 1 - .pre-commit-config.yaml | 4 ++-- .readthedocs.yml | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tail-call.yml b/.github/workflows/tail-call.yml index 4636372e26c41b..e32cbf0aaa3c3e 100644 --- a/.github/workflows/tail-call.yml +++ b/.github/workflows/tail-call.yml @@ -137,4 +137,3 @@ jobs: CC=clang-20 ./configure --with-tail-call-interp --disable-gil make all --jobs 4 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3 - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f65fa13cc4e46..7f9852d6ccf26f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,12 +43,12 @@ repos: exclude: ^Lib/test/test_tomllib/ - id: check-yaml - id: end-of-file-fixer - types: [python] + types_or: [python, yaml] exclude: Lib/test/tokenizedata/coding20731.py - id: end-of-file-fixer files: ^\.github/CODEOWNERS - id: trailing-whitespace - types_or: [c, inc, python, rst] + types_or: [c, inc, python, rst, yaml] - id: trailing-whitespace files: '^\.github/CODEOWNERS|\.(gram)$' diff --git a/.readthedocs.yml b/.readthedocs.yml index a57de00544e4e3..0a2c3f8345367f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -32,4 +32,3 @@ build: - make -C Doc venv html - mkdir _readthedocs - mv Doc/build/html _readthedocs/html - From 34405ac253f36b2f81aae2fb1bd96ab99cbd7d2e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 26 May 2025 18:33:22 +0300 Subject: [PATCH 3/3] Stricter regex and safer YAML Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7f9852d6ccf26f..822a8a9f4e5076 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,7 +46,7 @@ repos: types_or: [python, yaml] exclude: Lib/test/tokenizedata/coding20731.py - id: end-of-file-fixer - files: ^\.github/CODEOWNERS + files: '^\.github/CODEOWNERS$' - id: trailing-whitespace types_or: [c, inc, python, rst, yaml] - id: trailing-whitespace