]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-103484: Docs: add linkcheck allowed redirects entries for most cases (#103569)
authorRafael Fontenelle <rffontenelle@users.noreply.github.com>
Tue, 18 Apr 2023 02:57:53 +0000 (23:57 -0300)
committerGitHub <noreply@github.com>
Tue, 18 Apr 2023 02:57:53 +0000 (05:57 +0300)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Doc/conf.py

index e99b801d0ae87a9a9344ff7f2280b49af7fcd4c1..60404fd3829e5b55a8256ec48ee7e10b7c9ef08e 100644 (file)
@@ -254,9 +254,14 @@ coverage_ignore_c_items = {
 # Options for the link checker
 # ----------------------------
 
-# Ignore certain URLs.
-linkcheck_ignore = [r'https://bugs.python.org/(issue)?\d+']
-
+linkcheck_allowed_redirects = {
+    # bpo-NNNN -> BPO -> GH Issues
+    r'https://bugs.python.org/issue\?@action=redirect&bpo=\d+': 'https://github.com/python/cpython/issues/\d+',
+    # GH-NNNN used to refer to pull requests
+    r'https://github.com/python/cpython/issues/\d+': 'https://github.com/python/cpython/pull/\d+',
+    # :source:`something` linking files in the repository
+    r'https://github.com/python/cpython/tree/.*': 'https://github.com/python/cpython/blob/.*'
+}
 
 # Options for extensions
 # ----------------------