Skip to content

Commit

Permalink
Add checks for hardcoded direct links to PEPs and RFCs
Browse files Browse the repository at this point in the history
  • Loading branch information
CAM-Gerlach committed Jan 29, 2022
1 parent 7069d80 commit 765bd41
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,16 @@ repos:
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/pep-\d+'
files: '^pep-\d+\.(rst|txt)$'
exclude: '^pep-(0009|0287|8001)\.(rst|txt)$'
types: [text]
- id: check-direct-rfc-links
name: "Check that RFCs aren't linked directly"
language: pygrep
entry: '(rfc-editor\.org|ietf\.org)/[\.\-_\?\&\#\w/]*[Rr][Ff][Cc][\-_]?\d+'
files: '\.(rst|txt)$'
types: [text]
2 changes: 1 addition & 1 deletion pep-0340.txt
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ accepted, these can be changed to just "yield" of course.)
Used as follows::

block auto_retry(3, IOError):
f = urllib.urlopen("http://www.python.org/dev/peps/pep-0340/")
f = urllib.urlopen("https://www.example.com/")
print f.read()

5. It is possible to nest blocks and combine templates::
Expand Down
4 changes: 2 additions & 2 deletions pep-0427.txt
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ checker only needs to establish that RECORD matches the signature.

See

- https://datatracker.ietf.org/doc/html/rfc7515
- :rfc:`7515`
- https://datatracker.ietf.org/doc/html/draft-jones-jose-jws-json-serialization.html
- https://datatracker.ietf.org/doc/html/rfc7517
- :rfc:`7517`
- https://datatracker.ietf.org/doc/html/draft-jones-jose-json-private-key.html


Expand Down
4 changes: 2 additions & 2 deletions pep-0491.txt
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,9 @@ checker only needs to establish that RECORD matches the signature.

See

- https://datatracker.ietf.org/doc/html/rfc7515
- :rfc:`7515`
- https://datatracker.ietf.org/doc/html/draft-jones-jose-jws-json-serialization.html
- https://datatracker.ietf.org/doc/html/rfc7517
- :rfc:`7517`
- https://datatracker.ietf.org/doc/html/draft-jones-jose-json-private-key.html


Expand Down

0 comments on commit 765bd41

Please sign in to comment.