]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-103484: Docs: add linkcheck allowed redirects entries for most cases (GH-103569)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 18 Apr 2023 03:06:52 +0000 (20:06 -0700)
committerGitHub <noreply@github.com>
Tue, 18 Apr 2023 03:06:52 +0000 (20:06 -0700)
(cherry picked from commit f39e00f9521a0d412a5fc9a50f2a553ec2bb1a7c)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Doc/conf.py

index 18aff5d58ce89bd9fd37444792acae5cd0e02062..d89470973dacad0f46a61afe77a06429d65a2114 100644 (file)
@@ -242,9 +242,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
 # ----------------------