Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
c826909e03b73c8df4c4d2c98989e75643e7abaaf3ad6ba56dd30fff309ec3cb3fef66eff7423a829dff90add113712bbaafd0a40b51cde8a894d22File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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 PEPnumber 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 | ||
Member 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.
Uh oh!There was an error while loading. Please reload this page. | ||
| name: "'Author' must be list of 'Name <email@example.com>, ...'" | ||
| 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@example.com>'" | ||
| 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@example.com>'" | ||
| 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,7 +3,6 @@ Title: Python Interface Syntax | ||
| Version: $Revision$ | ||
| Last-Modified: $Date$ | ||
| Author: Michel Pelletier <michel@users.sourceforge.net> | ||
| Discussions-To: http://www.zope.org/Wikis/Interfaces | ||
hugovk marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| 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 |
|---|---|---|
| @@ -5,7 +5,6 @@ Last-Modified: $Date$ | ||
| Author: nas@arctrix.com (Neil Schemenauer), | ||
| tim.peters@gmail.com (Tim Peters), | ||
| magnus@hetland.org (Magnus Lie Hetland) | ||
| Discussions-To: python-iterators@lists.sourceforge.net | ||
hugovk marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Status: Final | ||
| Type: Standards Track | ||
| Content-Type: text/x-rst | ||
| 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 <benjamin@python.org> | ||
| BDFL-Delegate: Brett Cannon (on behalf of the steering council) | ||
Member 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. Member 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
| ||
| Discussions-To: https://discuss.python.org/t/pep-387-backwards-compatibilty-policy/ | ||
| PEP-Delegate: Brett Cannon <brett@python.org> | ||
| Discussions-To: https://discuss.python.org/t/pep-387-backwards-compatibilty-policy/4421 | ||
| Status: Active | ||
| Type: Process | ||
| Content-Type: text/x-rst | ||
Uh oh!
There was an error while loading. Please reload this page.
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.