-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
I was going to add pep-* autolinking to the python/cpython repo, but I realized that the URL requires the right amount of leading 0 in order to work. For example:
https://peps.python.org/pep-0008/ -- works fine
https://peps.python.org/pep-8/ -- fails
People rarely mention the leading 0s when they write e.g. PEP-8 in a message, and the autolinker doesn't offer any formatting option. Because of this, clicking the link results in a 404.
Would it be possible to create a script that, in case of 404, tries to extract the pep number and redirects to f'https://peps.python.org/pep-{num:04d}/'?
If it's handled on this end, it will have the advantage that every repo will be able to autolink PEPs, and it will also work for people editing the URL manually (something I happen to do from time to time).