Skip to content

Commit 814ceed

Browse files
authored
Lint: Add check-peps.py (python#3275)
``check-peps`` codifies the rules in PEP 1 and PEP 12 into a single place containing all of the PEP-specific checks. These are primarily header and metadata validation, and ensuring that direct links to RFCs and PEPs aren't used. Reviewed-by: Hugo van Kemenade <[email protected]> Reviewed-by: C.A.M. Gerlach <[email protected]>
1 parent fe3993d commit 814ceed

16 files changed

+1916
-5
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ contents.rst @AA-Turner
2020
.codespell/ @CAM-Gerlach @hugovk
2121
.codespellrc @CAM-Gerlach @hugovk
2222
.pre-commit-config.yaml @CAM-Gerlach @hugovk
23+
check-peps.py @AA-Turner @CAM-Gerlach @hugovk
2324

2425
# Git infrastructure
2526
.gitattributes @CAM-Gerlach

.github/workflows/lint.yml

+14
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,17 @@ jobs:
3535
uses: pre-commit/[email protected]
3636
with:
3737
extra_args: --all-files --hook-stage manual codespell || true
38+
39+
check-peps:
40+
name: Run check-peps
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v3
45+
- name: Set up Python 3
46+
uses: actions/setup-python@v4
47+
with:
48+
python-version: "3"
49+
50+
- name: Run check-peps
51+
run: python check-peps.py --detailed

.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ repos:
101101
# Local checks for PEP headers and more
102102
- repo: local
103103
hooks:
104+
# # Hook to run "check-peps.py"
105+
# - id: "check-peps"
106+
# name: "Check PEPs for metadata and content enforcement"
107+
# entry: "python check-peps.py"
108+
# language: "system"
109+
# files: "^pep-\d{4}\.(rst|txt)$"
110+
# require_serial: true
111+
104112
- id: check-no-tabs
105113
name: "Check tabs not used in PEPs"
106114
language: pygrep

0 commit comments

Comments
 (0)