linkcheck: Update configuration defaults for Sphinx 8.0 (#12630)

- Links that respond with HTTP 401 (unauthorized) responses are now considered ``broken`` by default.
- Timeouts that occur when checking a link are now reported with a distinct `timeout` status code, instead of the previous ``broken``.
- The previous behaviours are still available and can be configured on an opt-in basis per-project using ``conf.py``.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
James Addison
2024-07-20 20:41:22 +01:00
committed by GitHub
parent 2034f7d3b2
commit cc08854bc2
4 changed files with 25 additions and 73 deletions

View File

@@ -3714,20 +3714,17 @@ and the number of workers to use.
.. confval:: linkcheck_allow_unauthorized
:type: :code-py:`bool`
:default: :code-py:`True`
:default: :code-py:`False`
When a webserver responds with an HTTP 401 (unauthorised) response,
the current default behaviour of the *linkcheck* builder is
to treat the link as "working".
To change that behaviour, set this option to :code-py:`False`.
to treat the link as "broken".
To change that behaviour, set this option to :code-py:`True`.
.. attention::
The default value for this option will be changed in Sphinx 8.0;
from that version onwards,
HTTP 401 responses to checked hyperlinks will be treated
as "broken" by default.
.. xref RemovedInSphinx80Warning
.. versionchanged:: 8.0
The default value for this option changed to :code-py:`False`,
meaning HTTP 401 responses to checked hyperlinks
are treated as "broken" by default.
.. versionadded:: 7.3
@@ -3755,21 +3752,18 @@ and the number of workers to use.
.. confval:: linkcheck_report_timeouts_as_broken
:type: :code-py:`bool`
:default: :code-py:`True`
:default: :code-py:`False`
When an HTTP response is not received from a webserver before the configured
:confval:`linkcheck_timeout` expires,
the current default behaviour of the *linkcheck* builder is
to treat the link as 'broken'.
To report timeouts using a distinct report code of ``timeout``,
set :confval:`linkcheck_report_timeouts_as_broken` to :code-py:`False`.
If :confval:`linkcheck_timeout` expires while waiting for a response from
a hyperlink, the *linkcheck* builder will report the link as a ``timeout``
by default. To report timeouts as ``broken`` instead, you can
set :confval:`linkcheck_report_timeouts_as_broken` to :code-py:`True`.
.. attention::
From Sphinx 8.0 onwards, timeouts that occur while checking hyperlinks
.. versionchanged:: 8.0
The default value for this option changed to :code-py:`False`,
meaning timeouts that occur while checking hyperlinks
will be reported using the new 'timeout' status code.
.. xref RemovedInSphinx80Warning
.. versionadded:: 7.3
.. confval:: linkcheck_request_headers