diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26b2ccd5af3..d339a4fd449 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,16 +19,60 @@ repos: - repo: local hooks: - - id: check-created-exists - name: "Check all PEPs have created date" + - id: check-required-fields + name: "Check all PEPs have required fields" language: pygrep - entry: '^Created:' - args: ['--negate'] + entry: '(?-m:^PEP:(?=[\s\S]*\nTitle:)(?=[\s\S]*\nAuthor:)(?=[\s\S]*\nStatus:)(?=[\s\S]*\nType:)(?=[\s\S]*\nContent-Type:)(?=[\s\S]*\nCreated:))' + args: ['--negate', '--multiline'] + files: '^pep-\d+\.(rst|txt)$' + types: [text] + - id: validate-pep-number + name: "Validate PEP number field" + language: pygrep + entry: '(?-m:^PEP:(?:(?! +(0|[1-9][0-9]{0,3})\n)))' + args: ['--multiline'] + files: '^pep-\d+\.(rst|txt)$' + types: [text] + - id: validate-status + name: "Validate PEP Status field" + language: pygrep + entry: '^Status:(?:(?! +(Draft|Withdrawn|Rejected|Accepted|Final|Active|Provisional|Deferred|Superseded|April Fool!)$))' + files: '^pep-\d+\.(rst|txt)$' + types: [text] + - id: validate-type + name: "Validate PEP Type field" + language: pygrep + entry: '^Type:(?:(?! +(Standards Track|Informational|Process)$))' + files: '^pep-\d+\.(rst|txt)$' + types: [text] + - id: validate-content-type + name: "Validate PEP Content-Type field" + language: pygrep + entry: '^Content-Type:(?:(?! +text\/x-rst$))' + files: '^pep-\d+\.(rst|txt)$' + types: [text] + - id: validate-pep-references + name: "Validate PEP reference fields" + language: pygrep + entry: '^(Requires|Replaces|Superseded-By):(?:(?! +( ?(0|[1-9][0-9]{0,3}),?)+$))' files: '^pep-\d+\.(rst|txt)$' types: [text] - id: validate-created name: "Validate created dates" language: pygrep - entry: '^Created:(?:(?! +([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9])( \(|$)))' + entry: '^Created:(?:(?! +([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9])( \([^()]+\))?$))' + files: '^pep-\d+\.(rst|txt)$' + types: [text] + - id: validate-python-version + name: "Validate PEP Python-Version field" + language: pygrep + entry: '^Python-Version:(?:(?! +( ?[1-9]\.([0-9][0-9]?|x)(\.[1-9][0-9]?)?\??,?)+( \([^()]+\))?$))' + files: '^pep-\d+\.(rst|txt)$' + types: [text] + - id: validate-resolution + name: "Validate PEP Resolution field" + language: pygrep + entry: '(? Sponsor: Pablo Galindo diff --git a/pep-3118.txt b/pep-3118.txt index 74b56c4d0e5..b8d5f7cf749 100644 --- a/pep-3118.txt +++ b/pep-3118.txt @@ -7,7 +7,7 @@ Status: Final Type: Standards Track Content-Type: text/x-rst Created: 28-Aug-2006 -Python-Version: 3000 +Python-Version: 3.0 Post-History: Abstract diff --git a/pep-3128.txt b/pep-3128.txt index 7cddaf5ff16..c4c3e825446 100644 --- a/pep-3128.txt +++ b/pep-3128.txt @@ -8,7 +8,7 @@ Status: Rejected Type: Standards Track Content-Type: text/x-rst Created: 30-Apr-2007 -Python-Version: 2.6 and/or 3.0 +Python-Version: 2.6, 3.0 Post-History: 30-Apr-2007 diff --git a/pep-3150.txt b/pep-3150.txt index 3b8240a1386..5384b67e91a 100644 --- a/pep-3150.txt +++ b/pep-3150.txt @@ -9,7 +9,6 @@ Content-Type: text/x-rst Created: 09-Jul-2010 Python-Version: 3.4 Post-History: 2010-07-14, 2011-04-21, 2011-06-13 -Resolution: TBD Abstract