-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Lint: Update headers and checks per current guidance & provide helpful feedback #2484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c826909
e03b73c
8df4c4d
2c98989
e75643e
7abaaf3
ad6ba56
dd30fff
309ec3c
b3fef66
eff7423
a829dff
90add11
3712bba
afd0a40
b51cde8
a894d22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,6 @@ repos: | |
- id: mixed-line-ending | ||
name: "Normalize mixed line endings" | ||
args: [--fix=lf] | ||
- id: fix-byte-order-marker | ||
name: "Remove Unicode BOM" | ||
- id: file-contents-sorter | ||
name: "Sort codespell ignore list" | ||
files: '.codespell/ignore-words.txt' | ||
|
@@ -35,8 +33,8 @@ repos: | |
- id: check-vcs-permalinks | ||
name: "Check that VCS links are permalinks" | ||
|
||
- id: check-ast | ||
name: "Check Python AST" | ||
# - id: check-ast | ||
# name: "Check Python AST" | ||
- id: check-json | ||
name: "Check JSON" | ||
- id: check-toml | ||
|
@@ -76,70 +74,136 @@ repos: | |
entry: '\t' | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: check-required-fields | ||
name: "Check PEPs have all required fields" | ||
name: "Check PEPs have all required headers" | ||
language: pygrep | ||
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" | ||
name: "'PEP' header must be a number 1-9999" | ||
language: pygrep | ||
entry: '(?-m:^PEP:(?:(?! +(0|[1-9][0-9]{0,3})\n)))' | ||
args: ['--multiline'] | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-title | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yikes, 128 lines of regex hooks! "Now you have two problems" :) At least we need to worry about ReDoS attacks, it would only target the CI. Some of these are complex (longest is 475 chars) so I'm not going to review the individual regexes and don't really want to have to debug any of them :) I'm tempted to suggest a Python based checker instead, it could replace a lot of these with simpler string manipulation, and could replace some duplication in those that require regex. How about a flake8-pep plugin?? |
||
name: "'Title' must be 1-79 characters" | ||
language: pygrep | ||
entry: '(?<=\n)Title:(?:(?! +\S.{1,78}\n(?=[A-Z])))' | ||
args: ['--multiline'] | ||
files: '^pep-\d+\.(rst|txt)$' | ||
exclude: '^pep-(0499)\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-author | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: "'Author' must be list of 'Name <[email protected]>, ...'" | ||
language: pygrep | ||
entry: '(?<=\n)Author:(?:(?!((( +|\n {1,8})[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&''*+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?)(,|(?=\n[^ ])))+\n(?=[A-Z])))' | ||
args: [--multiline] | ||
files: '^pep-\d+\.rst$' | ||
types: [text] | ||
|
||
- id: validate-author-legacy | ||
name: "Legacy 'Author' must be a list of names/emails" | ||
language: pygrep | ||
entry: '(?<=\n)Author:(?:(?!((((( +|\n {1,8})[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&''*+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?)(,|(?=\n[^ ])))+)|(((( +|\n {1,8})[\w!#$%&''*+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+) \(([^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+)\)(,|(?=\n[^ ])))+))\n(?=[A-Z])))' | ||
args: [--multiline] | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-sponsor | ||
name: "'Sponsor' must have format 'Name <[email protected]>'" | ||
language: pygrep | ||
entry: '^Sponsor:(?: (?! *[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&''*+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?$))' | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-delegate | ||
name: "'Delegate' must have format 'Name <[email protected]>'" | ||
language: pygrep | ||
entry: '^(PEP|BDFL)-Delegate: (?:(?! *[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&''*+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?$))' | ||
files: '^pep-\d+\.(rst|txt)$' | ||
exclude: '^pep-(0451)\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-discussions-to | ||
name: "'Discussions-To' must be a thread URL" | ||
language: pygrep | ||
entry: '^Discussions-To: (?:(?!([\w\-]+@(python\.org|googlegroups\.com))|https://((discuss\.python\.org/t/([\w\-]+/)?\d+/?)|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/thread/[A-Za-z0-9]+/?))$))' | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-status | ||
name: "Validate PEP 'Status' field" | ||
name: "'Status' must be a valid PEP status" | ||
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" | ||
name: "'Type' must be a valid PEP type" | ||
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" | ||
name: "'Content-Type' must be 'text/x-rst'" | ||
language: pygrep | ||
entry: '^Content-Type:(?:(?! +text\/x-rst$))' | ||
entry: '^Content-Type:(?:(?! +text/x-rst$))' | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-pep-references | ||
name: "Validate PEP reference fields" | ||
name: "`Requires`/`Replaces`/`Superseded-By` must be 'NNN' PEP IDs" | ||
language: pygrep | ||
entry: '^(Requires|Replaces|Superseded-By):(?:(?! +( ?(0|[1-9][0-9]{0,3}),?)+$))' | ||
entry: '^(Requires|Replaces|Superseded-By):(?:(?! *( (0|[1-9][0-9]{0,3})(,|$))+$))' | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-created | ||
name: "Validate PEP 'Created' field" | ||
name: "'Created' must be a 'DD-mmm-YYYY' date" | ||
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" | ||
name: "'Python-Version' must be a 'X.Y[.Z]` version" | ||
language: pygrep | ||
entry: '^Python-Version:(?:(?! +( ?[1-9]\.([0-9][0-9]?|x)(\.[1-9][0-9]?)?\??,?)+( \([^()]+\))?$))' | ||
entry: '^Python-Version:(?:(?! *( [1-9]\.([0-9][0-9]?|x)(\.[1-9][0-9]?)?(,|$))+$))' | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-post-history | ||
name: "'Post-History' must be '`DD-mmm-YYYY <Thread URL>`__, ...'" | ||
language: pygrep | ||
entry: '(?<=\n)Post-History:(?:(?! ?\n|((( +|\n {1,14})(([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])|`([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]) <https://((discuss\.python\.org/t/([\w\-]+/)?\d+/?)|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/thread/[A-Za-z0-9]+/?(#[A-Za-z0-9]+)?))>`__)(,|(?=\n[^ ])))+\n(?=[A-Z\n]))))' | ||
args: [--multiline] | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: validate-resolution | ||
name: "Validate PEP 'Resolution' field" | ||
name: "'Resolution' must be a direct thread/message URL" | ||
language: pygrep | ||
entry: '(?<!\n\n)^Resolution: (?:(?!(https:\/\/\S*|:pep:`[a-zA-Z\d \-<>#]*?`)\n))' | ||
entry: '(?<!\n\n)(?<=\n)Resolution: (?:(?!https://((discuss\.python\.org/t/([\w\-]+/)?\d+(/\d+)?/?)|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/(message|thread)/[A-Za-z0-9]+/?(#[A-Za-z0-9]+)?))\n(?=\n)))' | ||
args: ['--multiline'] | ||
files: '^pep-\d+\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: check-direct-pep-links | ||
name: "Check that PEPs aren't linked directly" | ||
language: pygrep | ||
entry: '(dev/peps|peps\.python\.org)/pep-\d+' | ||
files: '^pep-\d+\.(rst|txt)$' | ||
exclude: '^pep-(0009|0287|0676|8001)\.(rst|txt)$' | ||
types: [text] | ||
|
||
- id: check-direct-rfc-links | ||
name: "Check that RFCs aren't linked directly" | ||
language: pygrep | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,14 @@ Title: Feature Requests | |
Version: $Revision$ | ||
Last-Modified: $Date$ | ||
Author: Jeremy Hylton <[email protected]> | ||
Status: Rejected | ||
Status: Withdrawn | ||
Type: Process | ||
Content-Type: text/x-rst | ||
Created: 12-Sep-2000 | ||
Post-History: | ||
Resolution: https://github.com/python/peps/pull/108#issuecomment-249603204 | ||
|
||
|
||
.. note:: This PEP has been rejected as obsolete. | ||
.. note:: This PEP has been `withdrawn as obsolete`_. | ||
All new feature requests should either go to the `Python bug tracker`_ | ||
for very simple requests or the `python-ideas`_ mailing list for | ||
everything else. The rest of this document is retained for historical | ||
|
@@ -335,6 +334,8 @@ Building and Installing | |
|
||
.. _`Python bug tracker`: https://bugs.python.org | ||
.. _`python-ideas`: https://mail.python.org/mailman/listinfo/python-ideas | ||
.. _`withdrawn as obsolete`: https://github.com/python/peps/pull/108#issuecomment-249603204 | ||
|
||
|
||
.. | ||
Local Variables: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ Author: [email protected] (Anthony Baxter), | |
Status: Superseded | ||
Type: Informational | ||
Content-Type: text/x-rst | ||
Created: 22-Aug-2001 (edited down on 9-Jan-2002 to become :pep:`102`) | ||
Created: 09-Jan-2002 | ||
Post-History: | ||
Superseded-By: 101 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ Title: Python Interface Syntax | |
Version: $Revision$ | ||
Last-Modified: $Date$ | ||
Author: Michel Pelletier <[email protected]> | ||
Discussions-To: http://www.zope.org/Wikis/Interfaces | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Status: Rejected | ||
Type: Standards Track | ||
Content-Type: text/x-rst | ||
|
@@ -12,6 +11,18 @@ Python-Version: 2.2 | |
Post-History: 21-Mar-2001 | ||
|
||
|
||
.. note:: | ||
|
||
The no-longer-available Zope interfaces wiki page | ||
(``https://www.zope.org/Wikis/Interfaces``) originally linked here, | ||
containing links to further resources for this PEP, | ||
can be `found on the Wayback Machine archive | ||
<https://web.archive.org/web/20050327013919/http://www.zope.org/Wikis/Interfaces/FrontPage>`__. | ||
Also, the Interface-Dev Zope mailing list on which this PEP was discussed | ||
was shut down, but `its archives remain available | ||
<https://mail.zope.dev/pipermail/interface-dev/>`__. | ||
|
||
|
||
Rejection Notice | ||
================ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ Title: Object Adaptation | |
Version: $Revision$ | ||
Last-Modified: $Date$ | ||
Author: [email protected] (Alex Martelli), | ||
[email protected] (Clark C. Evans) | ||
[email protected] (Clark C. Evans) | ||
Status: Rejected | ||
Type: Standards Track | ||
Content-Type: text/x-rst | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ Last-Modified: $Date$ | |
Author: [email protected] (Neil Schemenauer), | ||
[email protected] (Tim Peters), | ||
[email protected] (Magnus Lie Hetland) | ||
Discussions-To: [email protected] | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Status: Final | ||
Type: Standards Track | ||
Content-Type: text/x-rst | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ Title: Defining Python Source Code Encodings | |
Version: $Revision$ | ||
Last-Modified: $Date$ | ||
Author: [email protected] (Marc-André Lemburg), | ||
[email protected] (Martin von Löwis) | ||
[email protected] (Martin von Löwis) | ||
Status: Final | ||
Type: Standards Track | ||
Content-Type: text/x-rst | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ PEP: 282 | |
Title: A Logging System | ||
Version: $Revision$ | ||
Last-Modified: $Date$ | ||
Author: vinay_sajip at red-dove.com (Vinay Sajip), [email protected] (Trent Mick) | ||
Author: vinay_sajip at red-dove.com (Vinay Sajip), | ||
[email protected] (Trent Mick) | ||
Status: Final | ||
Type: Standards Track | ||
Content-Type: text/x-rst | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ Title: Reliable Acquisition/Release Pairs | |
Version: $Revision$ | ||
Last-Modified: $Date$ | ||
Author: Michael Hudson <[email protected]>, | ||
Paul Moore <[email protected]> | ||
Paul Moore <[email protected]> | ||
Status: Rejected | ||
Type: Standards Track | ||
Content-Type: text/x-rst | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ PEP: 372 | |
Title: Adding an ordered dictionary to collections | ||
Version: $Revision$ | ||
Last-Modified: $Date$ | ||
Author: Armin Ronacher <[email protected]> | ||
Author: Armin Ronacher <[email protected]>, | ||
Raymond Hettinger <[email protected]> | ||
Status: Final | ||
Type: Standards Track | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ Title: Backwards Compatibility Policy | |
Version: $Revision$ | ||
Last-Modified: $Date$ | ||
Author: Benjamin Peterson <[email protected]> | ||
BDFL-Delegate: Brett Cannon (on behalf of the steering council) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a desire in #1672 to enforce PEP-Delegate in new PEPs but keep BDFL-Delegate in old ones. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this PEP is still "Active" it seems reasonable to change it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I didn't mass-change it; in this case though this PEP is explicitly stated to be approved |
||
Discussions-To: https://discuss.python.org/t/pep-387-backwards-compatibilty-policy/ | ||
PEP-Delegate: Brett Cannon <[email protected]> | ||
Discussions-To: https://discuss.python.org/t/pep-387-backwards-compatibilty-policy/4421 | ||
Status: Active | ||
Type: Process | ||
Content-Type: text/x-rst | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ Content-Type: text/x-rst | |
Created: 20-Feb-2014 | ||
Python-Version: 3.5 | ||
Post-History: 13-Mar-2014 | ||
Resolution: https://mail.python.org/archives/list/[email protected]/message/D63NDWHPF7OC2Z455MPHOW6QLLSNQUJ5/ | ||
|
||
|
||
Abstract | ||
======== | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ PEP: 477 | |
Title: Backport ensurepip (PEP 453) to Python 2.7 | ||
Version: $Revision$ | ||
Last-Modified: $Date$ | ||
Author: Donald Stufft <[email protected]> | ||
Author: Donald Stufft <[email protected]>, | ||
Nick Coghlan <[email protected]> | ||
BDFL-Delegate: Benjamin Peterson <[email protected]> | ||
Status: Final | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ Author: Trishank Karthik Kuppusamy <[email protected]>, | |
Vladimir Diaz <[email protected]>, | ||
Justin Cappos <[email protected]>, Marina Moore <[email protected]> | ||
BDFL-Delegate: Donald Stufft <[email protected]> | ||
Discussions-To: https://discuss.python.org/c/packaging | ||
Discussions-To: https://discuss.python.org/t/5666 | ||
Status: Draft | ||
Type: Standards Track | ||
Content-Type: text/x-rst | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed or uncommented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented it as a stopgap fix for #2402 , but depending on what we ultimately decide there, there's a chance we may want to restore it. That said, I can remove it, if you think its important.