Skip to content

Commit adc6491

Browse files
authored
Ignore broken links and allow redirects (#1005)
1 parent 71e46f0 commit adc6491

File tree

2 files changed

+43
-12
lines changed

2 files changed

+43
-12
lines changed

conf.py

+42-11
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,55 @@
4444
# Set to '' to prevent appending "documentation" to the site title
4545
html_title = ""
4646

47+
linkcheck_allowed_redirects = {
48+
# Edit page
49+
r"https://docs.google.com/document/d/.*/": r"https://docs.google.com/document/d/.*/edit",
50+
# Canonical
51+
r"https://docs.python.org/": r"https://docs.python.org/3/",
52+
# Translations with country codes
53+
r"https://docs.python.org/[a-z-]+/": r"https://docs.python.org/[a-z-]+/3/",
54+
# Personal /my/ links redirect to login page
55+
r"https://discuss.python.org/my/.*": r"https://discuss.python.org/login-preferences",
56+
# Login page
57+
r"https://github.com/python/core-workflow/issues/new.*": r"https://github.com/login.*",
58+
# Archive redirect
59+
r"https://github.com/python/cpython/archive/main.zip": r"https://codeload.github.com/python/cpython/zip/refs/heads/main",
60+
# Blob to tree
61+
r"https://github.com/python/cpython/blob/.*": r"https://github.com/python/cpython/tree/.*",
62+
# HackMD shortcuts
63+
r"https://hackmd.io/s/.*": r"https://hackmd.io/@.*",
64+
# Read the Docs
65+
r"https://virtualenv.pypa.io/": r"https://virtualenv.pypa.io/en/latest/",
66+
r"https://www.sphinx-doc.org/": r"https://www.sphinx-doc.org/en/master/",
67+
# Cookie consent
68+
r"https://www.youtube.com/playlist.*": r"https://consent.youtube.com/ml.*",
69+
}
70+
4771
# ignore linkcheck anchors for /#/$ANCHOR since it is used for
4872
# dynamic pages such as http://buildbot.python.org/all/#/console
4973
# http://www.sphinx-doc.org/en/stable/config.html?highlight=linkcheck#confval-linkcheck_anchors_ignore
5074
linkcheck_anchors_ignore = [
5175
# match any anchor that starts with a '/' since this is an invalid HTML anchor
5276
r'\/.*',
5377
]
78+
79+
linkcheck_ignore = [
80+
# The voters repo is private and appears as a 404
81+
'https://github.com/python/voters/',
82+
# The python-core team link is private, redirects to login
83+
'https://github.com/orgs/python/teams/python-core',
84+
# The Discourse groups are private unless you are logged in
85+
'https://discuss.python.org/groups/staff',
86+
'https://discuss.python.org/groups/moderators',
87+
'https://discuss.python.org/groups/admins',
88+
# The crawler gets "Anchor not found" for GitHub anchors
89+
r'https://github.com.+?#L\d+',
90+
r'https://github.com/cli/cli#installation',
91+
r'https://github.com/github/renaming#renaming-existing-branches',
92+
# Discord doesn't allow robot crawlers: "403 Client Error: Forbidden"
93+
r'https://support.discord.com/hc/en-us/articles/219070107-Server-Nicknames',
94+
]
95+
5496
rediraffe_redirects = {
5597
"clang.rst": "advanced-tools/clang.rst",
5698
"coverity.rst": "advanced-tools/coverity.rst",
@@ -90,17 +132,6 @@
90132
"triaging.rst": "triage/triaging.rst",
91133
}
92134

93-
linkcheck_ignore = [
94-
# The voters repo is private and appears as a 404
95-
'https://github.com/python/voters/',
96-
# The python-core team link is private, redirects to login
97-
'https://github.com/orgs/python/teams/python-core',
98-
# The Discourse groups are private unless you are logged in
99-
'https://discuss.python.org/groups/staff',
100-
'https://discuss.python.org/groups/moderators',
101-
'https://discuss.python.org/groups/admins',
102-
]
103-
104135
intersphinx_mapping = {
105136
'python': ('https://docs.python.org/3', None),
106137
}

getting-started/pull-request-lifecycle.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ Here are the steps needed in order to sign the CLA:
343343
.. _PSF license: https://docs.python.org/dev/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python
344344
.. _contributor agreement: https://www.python.org/psf/contrib/
345345
.. _contributor form: https://www.python.org/psf/contrib/contrib-form/
346-
.. _Python Software Foundation: https://www.python.org/psf/
346+
.. _Python Software Foundation: https://www.python.org/psf-landing/
347347

348348

349349
Submitting

0 commit comments

Comments
 (0)