From aa460c5932066a3004f74ee4b0617a78a0fb02c9 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Mon, 17 Apr 2023 23:57:53 -0300 Subject: [PATCH] GH-103484: Docs: add linkcheck allowed redirects entries for most cases (GH-103569) (cherry picked from commit f39e00f9521a0d412a5fc9a50f2a553ec2bb1a7c) Co-authored-by: Rafael Fontenelle Co-authored-by: Hugo van Kemenade --- Doc/conf.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Doc/conf.py b/Doc/conf.py index 18aff5d58ce89b..d89470973dacad 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -242,9 +242,14 @@ # 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 # ----------------------