2021-02-08 10:20:51 -05:00
|
|
|
repos:
|
2021-03-22 15:29:08 -04:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
|
|
rev: v3.4.0
|
|
|
|
hooks:
|
|
|
|
- id: mixed-line-ending
|
|
|
|
name: Normalize mixed line endings
|
|
|
|
args: [--fix=lf]
|
|
|
|
|
2021-02-08 10:20:51 -05:00
|
|
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
2021-03-22 15:29:08 -04:00
|
|
|
rev: v1.8.0
|
2021-02-08 10:20:51 -05:00
|
|
|
hooks:
|
|
|
|
- id: rst-backticks
|
|
|
|
- id: rst-inline-touching-normal
|
2021-03-22 15:29:08 -04:00
|
|
|
files: '^pep-\d+\.txt|\.rst$'
|
|
|
|
types: [text]
|
|
|
|
- id: rst-directive-colons
|
|
|
|
files: '^pep-\d+\.txt|\.rst$'
|
|
|
|
types: [text]
|
|
|
|
|
|
|
|
- repo: local
|
|
|
|
hooks:
|
2021-03-23 10:55:26 -04:00
|
|
|
- id: check-required-fields
|
|
|
|
name: "Check all PEPs have required fields"
|
2021-03-22 15:29:08 -04:00
|
|
|
language: pygrep
|
2021-03-23 10:55:26 -04:00
|
|
|
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}),?)+$))'
|
2021-03-22 15:29:08 -04:00
|
|
|
files: '^pep-\d+\.(rst|txt)$'
|
|
|
|
types: [text]
|
|
|
|
- id: validate-created
|
|
|
|
name: "Validate created dates"
|
|
|
|
language: pygrep
|
2021-03-23 10:55:26 -04:00
|
|
|
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
|
2022-01-20 19:46:25 -05:00
|
|
|
entry: '(?<!\n\n)^Resolution: (?:(?!(https:\/\/\S*|:pep:`[a-zA-Z\d \-<>#]*?`)\n))'
|
2021-03-23 10:55:26 -04:00
|
|
|
args: ['--multiline']
|
2021-03-22 15:29:08 -04:00
|
|
|
files: '^pep-\d+\.(rst|txt)$'
|
|
|
|
types: [text]
|