-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate PEP created dates and update linters (#1886)
* Check created date exists & matches format, and fix non-conforming * Automatically fix mixed EoLs on checkin and in one PEP * Add rst-directive-colons check, fix issue it found and refine regex
- Loading branch information
1 parent
6468255
commit e6fb0d8
Showing
7 changed files
with
590 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ensure files are always checked in with consistent line endings | ||
* text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
pep-0000.txt | ||
pep-0000.rst | ||
pep-????.html | ||
peps.rss | ||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*~ | ||
*env | ||
.vscode | ||
*.swp | ||
/build | ||
pep-0000.txt | ||
pep-0000.rst | ||
pep-????.html | ||
peps.rss | ||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*~ | ||
*env | ||
.vscode | ||
*.swp | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,34 @@ | ||
repos: | ||
- 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] | ||
|
||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.7.1 | ||
rev: v1.8.0 | ||
hooks: | ||
- id: rst-backticks | ||
- id: rst-inline-touching-normal | ||
files: '^pep-\d+\.txt|\.rst$' | ||
types: [text] | ||
- id: rst-directive-colons | ||
files: '^pep-\d+\.txt|\.rst$' | ||
types: [text] | ||
|
||
- repo: local | ||
hooks: | ||
- id: check-created-exists | ||
name: "Check all PEPs have created date" | ||
language: pygrep | ||
entry: '^Created:' | ||
args: ['--negate'] | ||
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])( \(|$)))' | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.