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
This commit is contained in:
parent
6468255679
commit
e6fb0d8ca6
|
@ -0,0 +1,2 @@
|
||||||
|
# Ensure files are always checked in with consistent line endings
|
||||||
|
* text eol=lf
|
|
@ -1,6 +1,34 @@
|
||||||
repos:
|
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
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||||
rev: v1.7.1
|
rev: v1.8.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: rst-backticks
|
- id: rst-backticks
|
||||||
- id: rst-inline-touching-normal
|
- 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]
|
||||||
|
|
|
@ -263,7 +263,7 @@ If stdin and/or stdout is redirected to a pipe, ``sys.stdin`` and/or
|
||||||
But in UTF-8 Mode, ``sys.stdin`` and ``sys.stdout`` always use the UTF-8
|
But in UTF-8 Mode, ``sys.stdin`` and ``sys.stdout`` always use the UTF-8
|
||||||
encoding.
|
encoding.
|
||||||
|
|
||||||
.. note:
|
.. note::
|
||||||
There is no POSIX locale on Windows. The ANSI code page is used as
|
There is no POSIX locale on Windows. The ANSI code page is used as
|
||||||
the locale encoding, and this code page never uses the ASCII
|
the locale encoding, and this code page never uses the ASCII
|
||||||
encoding.
|
encoding.
|
||||||
|
|
|
@ -4,7 +4,7 @@ Author: Mark Shannon <mark@hotpy.org>
|
||||||
Status: Draft
|
Status: Draft
|
||||||
Type: Standards Track
|
Type: Standards Track
|
||||||
Content-Type: text/x-rst
|
Content-Type: text/x-rst
|
||||||
Created: 9-Feb-2021
|
Created: 09-Feb-2021
|
||||||
Post-History: 18-Feb-2021
|
Post-History: 18-Feb-2021
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ Discussions-To: https://discuss.python.org/t/7165
|
||||||
Status: Draft
|
Status: Draft
|
||||||
Type: Informational
|
Type: Informational
|
||||||
Content-Type: text/x-rst
|
Content-Type: text/x-rst
|
||||||
Created: 2021-03-17
|
Created: 17-Mar-2021
|
||||||
|
|
||||||
|
|
||||||
Abstract
|
Abstract
|
||||||
|
|
Loading…
Reference in New Issue