Use full URLs for links to issues and pull requests

This commit is contained in:
Adam Turner 2025-02-15 21:47:31 +00:00
parent 2c46e547f8
commit 139d6b0936
56 changed files with 225 additions and 128 deletions

View File

@ -436,7 +436,7 @@ class index(nodes.Invisible, nodes.Inline, nodes.TextElement):
*key* is categorization characters (usually a single character) for
general index page. For the details of this, please see also:
:rst:dir:`glossary` and issue #2320.
:rst:dir:`glossary` and https://github.com/sphinx-doc/sphinx/pull/2320.
"""

View File

@ -1193,13 +1193,14 @@ class StandaloneHTMLBuilder(Builder):
# sort JS/CSS before rendering HTML
try: # NoQA: SIM105
# Convert script_files to list to support non-list script_files (refs: #8889)
# Convert script_files to list to support non-list script_files
# See: https://github.com/sphinx-doc/sphinx/issues/8889
ctx['script_files'] = sorted(
ctx['script_files'], key=lambda js: js.priority
)
except AttributeError:
# Skip sorting if users modifies script_files directly (maybe via `html_context`).
# refs: #8885
# See: https://github.com/sphinx-doc/sphinx/issues/8885
#
# Note: priority sorting feature will not work in this case.
pass
@ -1503,7 +1504,8 @@ def setup(app: Sphinx) -> ExtensionMetadata:
'html_scaled_image_link', True, 'html', types=frozenset({bool})
)
app.add_config_value('html_baseurl', '', 'html', types=frozenset({str}))
# removal is indefinitely on hold (ref: https://github.com/sphinx-doc/sphinx/issues/10265)
# removal is indefinitely on hold
# See: https://github.com/sphinx-doc/sphinx/issues/10265
app.add_config_value(
'html_codeblock_linenos_style', 'inline', 'html', types=ENUM('table', 'inline')
)

View File

@ -802,7 +802,7 @@ def setup(app: Sphinx) -> ExtensionMetadata:
app.connect('config-inited', compile_linkcheck_allowed_redirects, priority=800)
# FIXME: Disable URL rewrite handler for github.com temporarily.
# ref: https://github.com/sphinx-doc/sphinx/issues/9435
# See: https://github.com/sphinx-doc/sphinx/issues/9435
# app.connect('linkcheck-process-uri', rewrite_github_anchor)
return {

View File

@ -76,7 +76,7 @@ PROMPT_PREFIX = '> '
if sys.platform == 'win32':
# On Windows, show questions as bold because of PowerShell's colour scheme
# (xref: https://github.com/sphinx-doc/sphinx/issues/5294).
# See: https://github.com/sphinx-doc/sphinx/issues/5294
from sphinx._cli.util.colour import bold as _question_colour
else:
from sphinx._cli.util.colour import purple as _question_colour
@ -163,9 +163,10 @@ def do_prompt(
else:
prompt = PROMPT_PREFIX + text + ': '
if USE_LIBEDIT:
# Note: libedit has a problem for combination of ``input()`` and escape
# sequence (see #5335). To avoid the problem, all prompts are not colored
# on libedit.
# Note: libedit has a problem for combination of ``input()``
# and escape sequences.
# To avoid the problem, all prompts are not colored on libedit.
# See https://github.com/sphinx-doc/sphinx/issues/5335
pass
else:
prompt = _question_colour(prompt)

View File

@ -47,7 +47,7 @@ if TYPE_CHECKING:
from sphinx.util.typing import ExtensionMetadata, OptionSpec
# re-export objects for backwards compatibility
# xref https://github.com/sphinx-doc/sphinx/issues/12295
# See: https://github.com/sphinx-doc/sphinx/issues/12295
from sphinx.domains.c._ast import ( # NoQA: F401
ASTAlignofExpr,
ASTArray,

View File

@ -51,7 +51,7 @@ if TYPE_CHECKING:
from sphinx.util.typing import ExtensionMetadata, OptionSpec
# re-export objects for backwards compatibility
# xref https://github.com/sphinx-doc/sphinx/issues/12295
# See: https://github.com/sphinx-doc/sphinx/issues/12295
from sphinx.domains.cpp._ast import ( # NoQA: F401
ASTAlignofExpr,
ASTArray,
@ -317,7 +317,7 @@ class CPPObject(ObjectDescription[ASTDeclaration]):
env.ref_context['cpp:parent_key'] = root.get_lookup_key()
# The lookup keys assume that no nested scopes exists inside overloaded functions.
# (see also #5191)
# See: https://github.com/sphinx-doc/sphinx/issues/5191
# Example:
# .. cpp:function:: void f(int)
# .. cpp:function:: void f(double)

View File

@ -604,7 +604,8 @@ class Symbol:
return None
# We have now matched part of a nested name, and need to match more
# so even if we should match_self before, we definitely shouldn't
# even more. (see also issue #2666)
# even more.
# See: https://github.com/sphinx-doc/sphinx/issues/2666
match_self = False
parent_symbol = symbol

View File

@ -38,7 +38,7 @@ if TYPE_CHECKING:
from sphinx.util.typing import ExtensionMetadata, OptionSpec
# re-export objects for backwards compatibility
# xref https://github.com/sphinx-doc/sphinx/issues/12295
# See: https://github.com/sphinx-doc/sphinx/issues/12295
from sphinx.domains.python._annotations import ( # NoQA: F401
_parse_arglist, # for sphinx-immaterial

View File

@ -146,7 +146,8 @@ def _resolve_toctree(
# </ul>
#
# The transformation is made in two passes in order to avoid
# interactions between marking and pruning the tree (see bug #1046).
# interactions between marking and pruning the tree.
# See: https://github.com/sphinx-doc/sphinx/issues/1046
toctree_ancestors = _get_toctree_ancestors(env.toctree_includes, docname)
included = Matcher(env.config.include_patterns)

View File

@ -288,7 +288,8 @@ def between(
# This class is used only in ``sphinx.ext.autodoc.directive``,
# But we define this class here to keep compatibility (see #4538)
# But we define this class here to keep compatibility
# See: https://github.com/sphinx-doc/sphinx/issues/4538
class Options(dict[str, Any]):
"""A dict/attribute hybrid that returns None on nonexisting keys."""
@ -3021,7 +3022,7 @@ class AttributeDocumenter( # type: ignore[misc]
try:
# Disable `autodoc_inherit_docstring` temporarily to avoid to obtain
# a docstring from the value which descriptor returns unexpectedly.
# ref: https://github.com/sphinx-doc/sphinx/issues/7805
# See: https://github.com/sphinx-doc/sphinx/issues/7805
orig = self.config.autodoc_inherit_docstrings
self.config.autodoc_inherit_docstrings = False
return super().get_doc()

View File

@ -291,7 +291,7 @@ def import_object(
logger.debug('[autodoc] => %r', obj)
except TypeError:
# fallback of failure on logging for broken object
# refs: https://github.com/sphinx-doc/sphinx/issues/9095
# See: https://github.com/sphinx-doc/sphinx/issues/9095
logger.debug('[autodoc] => %r', (obj,))
object_name = attrname

View File

@ -152,7 +152,7 @@ def patched_get_language() -> Iterator[None]:
"""Patch docutils.languages.get_language() temporarily.
This ignores the second argument ``reporter`` to suppress warnings.
refs: https://github.com/sphinx-doc/sphinx/issues/3788
See: https://github.com/sphinx-doc/sphinx/issues/3788
"""
from docutils.languages import get_language
@ -178,7 +178,7 @@ def patched_rst_get_language() -> Iterator[None]:
This should also work for old versions of docutils,
because reporter is none by default.
refs: https://github.com/sphinx-doc/sphinx/issues/10179
See: https://github.com/sphinx-doc/sphinx/issues/10179
"""
from docutils.parsers.rst.languages import get_language

View File

@ -170,7 +170,7 @@ def getorigbases(obj: Any) -> tuple[Any, ...] | None:
return None
# Get __orig_bases__ from obj.__dict__ to avoid accessing the parent's __orig_bases__.
# refs: https://github.com/sphinx-doc/sphinx/issues/9607
# See: https://github.com/sphinx-doc/sphinx/issues/9607
__dict__ = safe_getattr(obj, '__dict__', {})
__orig_bases__ = __dict__.get('__orig_bases__')
if isinstance(__orig_bases__, tuple) and len(__orig_bases__) > 0:
@ -763,7 +763,7 @@ def signature(
# pass an internal parameter __validate_parameters__=False to Signature
#
# For example, this helps a function having a default value `inspect._empty`.
# refs: https://github.com/sphinx-doc/sphinx/issues/7935
# See: https://github.com/sphinx-doc/sphinx/issues/7935
return Signature(
parameters, return_annotation=return_annotation, __validate_parameters__=False
)

View File

@ -123,7 +123,8 @@ class InventoryFile:
if ':' not in type:
# wrong type value. type should be in the form of "{domain}:{objtype}"
#
# Note: To avoid the regex DoS, this is implemented in python (refs: #8175)
# Note: To avoid the regex DoS, this is implemented in Python
# See: https://github.com/sphinx-doc/sphinx/issues/8175
continue
if type == 'py:module' and (type, name) in inv:
# due to a bug in 1.1 and below,

View File

@ -179,7 +179,8 @@ def apply_source_workaround(node: Element) -> None:
)
node.source, node.line = node.parent.source, node.parent.line
# workaround: literal_block under bullet list (#4913)
# workaround: literal_block under bullet list
# See: https://github.com/sphinx-doc/sphinx/issues/4913
if isinstance(node, nodes.literal_block) and node.source is None:
with contextlib.suppress(ValueError):
node.source = get_node_source(node)
@ -195,10 +196,14 @@ def apply_source_workaround(node: Element) -> None:
if isinstance(
node,
(
nodes.rubric # #1305 rubric directive
| nodes.line # #1477 line node
| nodes.image # #3093 image directive in substitution
| nodes.field_name # #3335 field list syntax
# https://github.com/sphinx-doc/sphinx/issues/1305 rubric directive
nodes.rubric
# https://github.com/sphinx-doc/sphinx/issues/1477 line node
| nodes.line
# https://github.com/sphinx-doc/sphinx/issues/3093 image directive in substitution
| nodes.image
# https://github.com/sphinx-doc/sphinx/issues/3335 field list syntax
| nodes.field_name
),
):
logger.debug(
@ -709,7 +714,7 @@ def _copy_except__document(el: Element) -> Element:
"""Monkey-patch ```nodes.Element.copy``` to not copy the ``_document``
attribute.
xref: https://github.com/sphinx-doc/sphinx/issues/11116#issuecomment-1376767086
See: https://github.com/sphinx-doc/sphinx/issues/11116#issuecomment-1376767086
"""
newnode = object.__new__(el.__class__)
# set in Element.__init__()

View File

@ -36,7 +36,9 @@ tex_replacements = [
]
# A map to avoid TeX ligatures or character replacements in PDF output
# xelatex/lualatex/uplatex are handled differently (#5790, #6888)
# xelatex/lualatex/uplatex are handled differently
# https://github.com/sphinx-doc/sphinx/pull/5790
# https://github.com/sphinx-doc/sphinx/pull/6888
ascii_tex_replacements = [
# Note: the " renders curly in OT1 encoding but straight in T1, T2A, LY1...
# escaping it to \textquotedbl would break documents using OT1

View File

@ -205,7 +205,8 @@ def get_type_hints(
# Invalid object is given. But try to get __annotations__ as a fallback.
return safe_getattr(obj, '__annotations__', {})
except KeyError:
# a broken class found (refs: https://github.com/sphinx-doc/sphinx/issues/8084)
# a broken class found
# See: https://github.com/sphinx-doc/sphinx/issues/8084
return {}

View File

@ -199,10 +199,11 @@ class HTML5Translator(SphinxTranslator, BaseTranslator): # type: ignore[misc]
# If required parameters are still to come, then put the comma after
# the parameter. Otherwise, put the comma before. This ensures that
# signatures like the following render correctly (see issue #1001):
# signatures like the following render correctly:
#
# foo([a, ]b, c[, d])
#
# See: https://github.com/sphinx-doc/sphinx/issues/1001
def visit_desc_parameter(self, node: Element) -> None:
on_separate_line = self.multi_line_parameter_list
if on_separate_line and not (

View File

@ -1847,7 +1847,8 @@ class LaTeXTranslator(SphinxTranslator):
else:
add_target(node['refid'])
# Temporary fix for https://github.com/sphinx-doc/sphinx/issues/11093
# TODO: investigate if a more elegant solution exists (see comments of #11093)
# TODO: investigate if a more elegant solution exists
# (see comments of https://github.com/sphinx-doc/sphinx/issues/11093)
if node.get('ismod', False):
# Detect if the previous nodes are label targets. If so, remove
# the refid thereof from node['ids'] to avoid duplicated ids.
@ -2500,7 +2501,7 @@ class LaTeXTranslator(SphinxTranslator):
# FIXME: Workaround to avoid circular import
# refs: https://github.com/sphinx-doc/sphinx/issues/5433
# See: https://github.com/sphinx-doc/sphinx/issues/5433
from sphinx.builders.latex.nodes import ( # NoQA: E402 # isort:skip
HYPERLINK_SUPPORT_NODES,
captioned_literal_block,

View File

@ -258,8 +258,8 @@ describe("htmlToText", function() {
it("basic case", () => {
expect(Search.htmlToText(testHTML).trim().split(/\s+/)).toEqual([
'Getting', 'Started', 'Some', 'text',
'Other', 'Section', 'Other', 'text',
'Getting', 'Started', 'Some', 'text',
'Other', 'Section', 'Other', 'text',
'Yet', 'Another', 'Section', 'More', 'text'
]);
});
@ -269,7 +269,7 @@ describe("htmlToText", function() {
});
});
// This is regression test for https://github.com/sphinx-doc/sphinx/issues/3150
// Regression test for https://github.com/sphinx-doc/sphinx/issues/3150
describe('splitQuery regression tests', () => {
it('can split English words', () => {

View File

@ -1,5 +1,6 @@
"""Test case for #11387 corner case involving inherited
members with type annotations on python 3.9 and earlier
"""Test case for https://github.com/sphinx-doc/sphinx/issues/11387,
corner case involving inherited members with type annotations
on python 3.9 and earlier
"""

View File

@ -5,6 +5,6 @@ foo
.. py:function:: hello()
:param bug: #5800
:param bug: https://github.com/sphinx-doc/sphinx/pull/5800
.. todo:: todo in param field

View File

@ -1,7 +1,8 @@
.. _index:
test-html_entity (#3450)
=========================
test-html_entity
================
.. https://github.com/sphinx-doc/sphinx/issues/3450
Empty cell
----------

View File

@ -2,7 +2,8 @@
Admonitions
==================
.. #1206 gettext did not translate admonition directive's title
.. https://github.com/sphinx-doc/sphinx/issues/1206
gettext did not translate admonition directive's title
.. attention:: attention title

View File

@ -2,7 +2,8 @@
i18n with external links
========================
.. #1044 external-links-dont-work-in-localized-html
.. https://github.com/sphinx-doc/sphinx/issues/1044
external-links-dont-work-in-localized-html
External link to Python_.

View File

@ -2,7 +2,8 @@
i18n with Footnote
==================
.. #955 cant-build-html-with-footnotes-when-using
.. https://github.com/sphinx-doc/sphinx/issues/955
cant-build-html-with-footnotes-when-using
[100]_ Contents [#]_ for `i18n with Footnote`_ [ref]_ [#named]_ [*]_.
second footnote_ref [100]_.

View File

@ -2,7 +2,8 @@
i18n with seealso
============================
.. #960 directive-seelaso-ignored-in-the-gettext
.. https://github.com/sphinx-doc/sphinx/issues/960
directive-seelaso-ignored-in-the-gettext
.. seealso:: short text 1

View File

@ -69,4 +69,6 @@ subsubsection
otherdoc
* Embedded standalone hyperlink reference(refs: #5948): `subsection <section1_>`_.
* Embedded standalone hyperlink reference: `subsection <section1_>`_.
.. See: https://github.com/sphinx-doc/sphinx/issues/5948

View File

@ -17,7 +17,7 @@ todo
.. todo::
Test with |sub| (see #286).
Test with |sub| (see https://github.com/sphinx-doc/sphinx/issues/286).
.. |sub| replace:: substitution references

View File

@ -2,7 +2,8 @@
Testing footnote and citation
================================
.. #1058 footnote-backlinks-do-not-work
.. https://github.com/sphinx-doc/sphinx/issues/1058
footnote-backlinks-do-not-work
numbered footnote
--------------------

View File

@ -44,8 +44,9 @@ References
.. [Ref1] Reference target.
.. [Ref_1] Reference target 2.
Test for issue #1157
====================
Test for combination of 'globaltoc.html' and hidden toctree
===========================================================
.. https://github.com/sphinx-doc/sphinx/issues/1157
This used to crash:
@ -54,8 +55,9 @@ This used to crash:
.. toctree::
:hidden:
Test for issue #1700
====================
Test for ability to name a toc tree
===================================
.. https://github.com/sphinx-doc/sphinx/pull/1700
:ref:`mastertoc`

View File

@ -34,8 +34,9 @@ subsection
subsubsection
-------------
Test for issue #1157
====================
Test for combination of 'globaltoc.html' and hidden toctree
===========================================================
.. https://github.com/sphinx-doc/sphinx/issues/1157
This used to crash:

View File

@ -1,4 +1,5 @@
Regression test for issue 10495
===============================
Regression test for KeyboardTransform iteration
===============================================
.. https://github.com/sphinx-doc/sphinx/issues/10495
:kbd:`spanish - inquisition`

View File

@ -25,7 +25,8 @@ def test_dirhtml(app):
assert 'href="foo/foo_2/"' in content
assert 'href="bar/"' in content
# objects.inv (refs: #7095)
# objects.inv
# See: https://github.com/sphinx-doc/sphinx/issues/7095
with (app.outdir / 'objects.inv').open('rb') as f:
invdata = InventoryFile.load(f, 'path/to', posixpath.join)

View File

@ -61,7 +61,7 @@ def test_build_gettext(app: SphinxTestApp) -> None:
# directory items are grouped into sections
assert (app.outdir / 'subdir.pot').is_file()
# regression test for issue #960
# regression test for https://github.com/sphinx-doc/sphinx/issues/960
catalog = (app.outdir / 'markup.pot').read_text(encoding='utf8')
assert 'msgid "something, something else, something more"' in catalog
@ -125,7 +125,7 @@ def test_msgfmt(app: SphinxTestApp) -> None:
confoverrides={'gettext_compact': False},
)
def test_gettext_index_entries(app: SphinxTestApp) -> None:
# regression test for #976
# regression test for https://github.com/sphinx-doc/sphinx/issues/976
app.build(filenames=[app.srcdir / 'index_entries.txt'])
pot = (app.outdir / 'index_entries.pot').read_text(encoding='utf8')
@ -155,7 +155,7 @@ def test_gettext_index_entries(app: SphinxTestApp) -> None:
confoverrides={'gettext_compact': False, 'gettext_additional_targets': []},
)
def test_gettext_disable_index_entries(app: SphinxTestApp) -> None:
# regression test for #976
# regression test for https://github.com/sphinx-doc/sphinx/issues/976
app.env._pickled_doctree_cache.clear() # clear cache
app.build(filenames=[app.srcdir / 'index_entries.txt'])
@ -270,7 +270,7 @@ def test_gettext_prolog_epilog_substitution(app: SphinxTestApp) -> None:
confoverrides={'gettext_compact': False, 'gettext_additional_targets': ['image']},
)
def test_gettext_prolog_epilog_substitution_excluded(app: SphinxTestApp) -> None:
# regression test for #9428
# regression test for https://github.com/sphinx-doc/sphinx/issues/9428
app.build(force_all=True)
assert (app.outdir / 'prolog_epilog_substitution_excluded.pot').is_file()

View File

@ -586,7 +586,7 @@ def test_html_signaturereturn_icon(app):
srcdir=os.urandom(4).hex(),
)
def test_html_remove_sources_before_write_gh_issue_10786(app):
# see: https://github.com/sphinx-doc/sphinx/issues/10786
# See: https://github.com/sphinx-doc/sphinx/issues/10786
target = app.srcdir / 'img.png'
def handler(app):

View File

@ -70,7 +70,7 @@ from tests.test_builders.xpath_util import check_xpath
@pytest.mark.test_params(shared_result='test_build_html_tocdepth')
def test_tocdepth(app, cached_etree_parse, fname, path, check, be_found):
app.build()
# issue #1251
# https://github.com/sphinx-doc/sphinx/issues/1251
check_xpath(cached_etree_parse(app.outdir / fname), fname, path, check, be_found)

View File

@ -1300,7 +1300,8 @@ def test_latex_show_urls_is_no(app):
},
)
def test_latex_show_urls_footnote_and_substitutions(app):
# hyperlinks in substitutions should not effect to make footnotes (refs: #4784)
# hyperlinks in substitutions should not effect to make footnotes
# See: https://github.com/sphinx-doc/sphinx/issues/4784
test_latex_show_urls_is_footnote(app)
@ -1996,7 +1997,8 @@ def test_latex_labels(app):
r'\label{\detokenize{otherdoc::doc}}'
) in result
# Embedded standalone hyperlink reference (refs: #5948)
# Embedded standalone hyperlink reference
# See: https://github.com/sphinx-doc/sphinx/issues/5948
assert result.count(r'\label{\detokenize{index:section1}}') == 1

View File

@ -43,7 +43,8 @@ def test_maxwitdh_with_prefix(app: SphinxTestApp) -> None:
@with_text_app()
def test_lineblock(app: SphinxTestApp) -> None:
# regression test for #1109: need empty line after line block
# regression test for https://github.com/sphinx-doc/sphinx/issues/1109:
# need empty line after line block
app.build()
result = (app.outdir / 'lineblock.txt').read_text(encoding='utf8')
expect = '* one\n\n line-block 1\n line-block 2\n\nfollowed paragraph.\n'

View File

@ -671,7 +671,7 @@ def test_nitpick_ignore_regex_fullmatch(app):
def test_conf_py_language_none(tmp_path):
"""Regression test for #10474."""
"""Regression test for https://github.com/sphinx-doc/sphinx/issues/10474."""
# Given a conf.py file with language = None
(tmp_path / 'conf.py').write_text('language = None', encoding='utf-8')
@ -684,7 +684,7 @@ def test_conf_py_language_none(tmp_path):
@mock.patch('sphinx.config.logger')
def test_conf_py_language_none_warning(logger, tmp_path):
"""Regression test for #10474."""
"""Regression test for https://github.com/sphinx-doc/sphinx/issues/10474."""
# Given a conf.py file with language = None
(tmp_path / 'conf.py').write_text('language = None', encoding='utf-8')
@ -701,7 +701,7 @@ def test_conf_py_language_none_warning(logger, tmp_path):
def test_conf_py_no_language(tmp_path):
"""Regression test for #10474."""
"""Regression test for https://github.com/sphinx-doc/sphinx/issues/10474."""
# Given a conf.py file with no language attribute
(tmp_path / 'conf.py').touch()
@ -713,7 +713,7 @@ def test_conf_py_no_language(tmp_path):
def test_conf_py_nitpick_ignore_list(tmp_path):
"""Regression test for #11355."""
"""Regression test for https://github.com/sphinx-doc/sphinx/issues/11355."""
# Given a conf.py file with no language attribute
(tmp_path / 'conf.py').touch()
@ -729,7 +729,8 @@ def test_gettext_compact_command_line_true():
config = Config({}, {'gettext_compact': '1'})
config.add('gettext_compact', True, '', {bool, str})
# regression test for #8549 (-D gettext_compact=1)
# regression test for https://github.com/sphinx-doc/sphinx/issues/8549
# (-D gettext_compact=1)
assert config.gettext_compact is True
@ -737,7 +738,8 @@ def test_gettext_compact_command_line_false():
config = Config({}, {'gettext_compact': '0'})
config.add('gettext_compact', True, '', {bool, str})
# regression test for #8549 (-D gettext_compact=0)
# regression test for https://github.com/sphinx-doc/sphinx/issues/8549
# (-D gettext_compact=0)
assert config.gettext_compact is False
@ -745,7 +747,8 @@ def test_gettext_compact_command_line_str():
config = Config({}, {'gettext_compact': 'spam'})
config.add('gettext_compact', True, '', {bool, str})
# regression test for #8549 (-D gettext_compact=spam)
# regression test for https://github.com/sphinx-doc/sphinx/issues/8549
# (-D gettext_compact=spam)
assert config.gettext_compact == 'spam'

View File

@ -483,7 +483,7 @@ def test_domain_c_ast_member_definitions():
check('member', 'T a = {1, 2}', {1: 'a'})
check('member', 'T a = {1, 2, 3}', {1: 'a'})
# test from issue #1539
# test from issue https://github.com/sphinx-doc/sphinx/issues/1539
check('member', 'CK_UTF8CHAR model[16]', {1: 'model'})
check('member', 'auto int a', {1: 'a'})
@ -515,17 +515,18 @@ def test_domain_c_ast_function_definitions():
check('function', 'void f(enum T)', {1: 'f'})
check('function', 'void f(enum T t)', {1: 'f'})
# test from issue #1539
# test from issue https://github.com/sphinx-doc/sphinx/issues/1539
check('function', 'void f(A x[])', {1: 'f'})
# test from issue #2377
# test from issue https://github.com/sphinx-doc/sphinx/issues/2377
check('function', 'void (*signal(int sig, void (*func)(int)))(int)', {1: 'signal'})
check('function', 'extern void f()', {1: 'f'})
check('function', 'static void f()', {1: 'f'})
check('function', 'inline void f()', {1: 'f'})
# tests derived from issue #1753 (skip to keep sanity)
# tests derived from https://github.com/sphinx-doc/sphinx/issues/1753
# (skip to keep sanity)
check('function', 'void f(float *q(double))', {1: 'f'})
check('function', 'void f(float *(*q)(double))', {1: 'f'})
check('function', 'void f(float (*q)(double))', {1: 'f'})
@ -565,7 +566,7 @@ def test_domain_c_ast_function_definitions():
with pytest.raises(DefinitionError):
parse('function', 'void f(int for)')
# from #8960
# from https://github.com/sphinx-doc/sphinx/issues/8960
check('function', 'void f(void (*p)(int, double), int i)', {1: 'f'})

View File

@ -314,7 +314,7 @@ def test_domain_cpp_ast_expressions():
for c, val in chars:
expr_check(f"{p}'{c}'_udl", 'clL_Zli4_udlE' + t + val + 'E')
expr_check('"abc"_udl', 'clL_Zli4_udlELA3_KcEE')
# from issue #7294
# from https://github.com/sphinx-doc/sphinx/issues/7294
expr_check('6.62607015e-34q_J', 'clL_Zli3q_JEL6.62607015e-34EE')
# fold expressions, paren, name
@ -829,7 +829,8 @@ def test_domain_cpp_ast_function_definitions():
{1: 'result__i.std::error_categoryCR', 2: '6resultiRKNSt14error_categoryE'},
)
check('function', 'int *f()', {1: 'f', 2: '1fv'})
# tests derived from issue #1753 (skip to keep sanity)
# tests derived from https://github.com/sphinx-doc/sphinx/issues/1753
# (skip to keep sanity)
check('function', 'f(int (&array)[10])', {2: '1fRA10_i', 3: '1fRAL10E_i'})
check('function', 'void f(int (&array)[10])', {2: '1fRA10_i', 3: '1fRAL10E_i'})
check('function', 'void f(float *q(double))', {2: '1fFPfdE'})
@ -920,10 +921,10 @@ def test_domain_cpp_ast_function_definitions():
{1: 'MakeThingy', 2: '10MakeThingyv'},
)
# from #8960
# from https://github.com/sphinx-doc/sphinx/issues/8960
check('function', 'void f(void (*p)(int, double), int i)', {2: '1fPFvidEi'})
# from #9535 comment
# from https://github.com/sphinx-doc/sphinx/issues/9535 comment
check('function', 'void f(void (*p)(int) = &foo)', {2: '1fPFviE'})
@ -1023,7 +1024,7 @@ def test_domain_cpp_ast_class_definitions():
check('class', '{key}A : B, C...', {1: 'A', 2: '1A'})
check('class', '{key}A : B..., C', {1: 'A', 2: '1A'})
# from #4094
# from https://github.com/sphinx-doc/sphinx/issues/4094
check(
'class',
'template<class, class = std::void_t<>> {key}has_var',
@ -1122,7 +1123,7 @@ def test_domain_cpp_ast_templates():
check('class', 'template<typename A<B>::C> {key}A', {2: 'I_N1AI1BE1CEE1A'})
check('class', 'template<typename A<B>::C = 42> {key}A', {2: 'I_N1AI1BE1CEE1A'})
# from #7944
# from https://github.com/sphinx-doc/sphinx/issues/7944
check(
'function',
'template<typename T, '
@ -1137,7 +1138,7 @@ def test_domain_cpp_ast_templates():
check('class', 'template<> {key}A<NS::B<>>', {2: 'IE1AIN2NS1BIEEE'})
# from #2058
# from https://github.com/sphinx-doc/sphinx/issues/2058
check(
'function',
'template<typename Char, typename Traits> '
@ -1360,7 +1361,7 @@ def test_domain_cpp_ast_template_args():
4: 'I0E5allowvP1FN4funcI1F1BXne1GL1EEE4typeE',
},
)
# from #3542
# from https://github.com/sphinx-doc/sphinx/issues/3542
check(
'type',
'template<typename T> {key}'

View File

@ -113,8 +113,19 @@ def test_process_doc(app):
),
)
assert_node(toctree[1][0], [compact_paragraph, reference, 'Test for issue #1157'])
assert_node(toctree[1][0][0], reference, anchorname='#test-for-issue-1157')
assert_node(
toctree[1][0],
[
compact_paragraph,
reference,
'Test for combination of globaltoc.html and hidden toctree',
],
)
assert_node(
toctree[1][0][0],
reference,
anchorname='#test-for-combination-of-globaltoc-html-and-hidden-toctree',
)
assert_node(
toctree[1][1][0],
addnodes.toctree,
@ -494,7 +505,14 @@ def test_document_toc(app):
[bullet_list, list_item, compact_paragraph, reference, 'subsubsection'],
),
)
assert_node(toctree[1][0], [compact_paragraph, reference, 'Test for issue #1157'])
assert_node(
toctree[1][0],
[
compact_paragraph,
reference,
'Test for combination of globaltoc.html and hidden toctree',
],
)
assert_node(toctree[2][0], [compact_paragraph, reference, 'Indices and tables'])
@ -553,7 +571,14 @@ def test_document_toc_only(app):
[bullet_list, list_item, compact_paragraph, reference, 'subsubsection'],
),
)
assert_node(toctree[1][0], [compact_paragraph, reference, 'Test for issue #1157'])
assert_node(
toctree[1][0],
[
compact_paragraph,
reference,
'Test for combination of globaltoc.html and hidden toctree',
],
)
assert_node(toctree[2][0], [compact_paragraph, reference, 'Indices and tables'])

View File

@ -437,7 +437,8 @@ def extract_toc(path):
)
def test_subpackage_in_toc(apidoc):
"""Make sure that empty subpackages with non-empty subpackages in them
are not skipped (issue #4520)
are not skipped
See: https://github.com/sphinx-doc/sphinx/issues/4520
"""
outdir = apidoc.outdir
assert (outdir / 'conf.py').is_file()

View File

@ -2916,7 +2916,7 @@ def test_autodoc(app):
assert content[3][0].astext() == 'autodoc_dummy_module.test()'
assert content[3][1].astext() == 'Dummy function using dummy.*'
# issue sphinx-doc/sphinx#2437
# See: https://github.com/sphinx-doc/sphinx/issues/2437
assert content[11][-1].astext() == (
"""Dummy class Bar with alias.

View File

@ -48,7 +48,8 @@ def test_autosectionlabel_html(app):
)
assert re.search(html, content, re.DOTALL)
# for smart_quotes (refs: #4027)
# for smart_quotes
# See: https://github.com/sphinx-doc/sphinx/issues/4027
html = (
'<li><p><a class="reference internal" '
'href="#this-one-s-got-an-apostrophe">'

View File

@ -336,7 +336,8 @@ def test_import_classes(rootdir):
import_classes('unknown.Unknown', None)
# got exception InheritanceException for wrong class or module
# not AttributeError (refs: #4019)
# not AttributeError
# See: https://github.com/sphinx-doc/sphinx/issues/4019
with pytest.raises(InheritanceException):
import_classes('unknown', '.')
with pytest.raises(InheritanceException):
@ -371,7 +372,8 @@ def test_import_classes(rootdir):
with pytest.raises(InheritanceException):
import_classes('encode_uri', 'sphinx.util')
# import submodule on current module (refs: #3164)
# import submodule on current module
# See: https://github.com/sphinx-doc/sphinx/issues/3164
classes = import_classes('sphinx', 'example')
assert classes == [DummyClass]
finally:

View File

@ -164,7 +164,8 @@ class TestSkipMember:
# Since python 3.7, namedtuple._asdict() has not been documented
# because there is no way to check the method is a member of the
# namedtuple class. This testcase confirms only it does not
# raise an error on building document (refs: #1455)
# raise an error on building document
# See: https://github.com/sphinx-doc/sphinx/issues/1455
self.assert_skip(
'class',
'_asdict',

View File

@ -95,8 +95,8 @@ def test_todo_not_included(app):
)
def test_todo_valid_link(app):
"""Test that the inserted "original entry" links for todo items have a target
that exists in the LaTeX output. The target was previously incorrectly
omitted (GitHub issue #1020).
that exists in the LaTeX output. The target was previously incorrectly omitted.
https://github.com/sphinx-doc/sphinx/issues/1020
"""
# Ensure the LaTeX output is built.
app.build(force_all=True)

View File

@ -279,7 +279,10 @@ def test_text_literalblock_warnings(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_text_definition_terms(app):
app.build()
# --- definition terms: regression test for #975, #2198, #2205
# --- definition terms: regression test for
# https://github.com/sphinx-doc/sphinx/issues/975,
# https://github.com/sphinx-doc/sphinx/issues/2198, and
# https://github.com/sphinx-doc/sphinx/issues/2205
result = (app.outdir / 'definition_terms.txt').read_text(encoding='utf8')
expect = (
'13. I18N WITH DEFINITION TERMS'
@ -301,7 +304,8 @@ def test_text_definition_terms(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_text_glossary_term(app):
app.build()
# --- glossary terms: regression test for #1090
# --- glossary terms: regression test for
# https://github.com/sphinx-doc/sphinx/issues/1090
result = (app.outdir / 'glossary_terms.txt').read_text(encoding='utf8')
expect = r"""18. I18N WITH GLOSSARY TERMS
****************************
@ -336,7 +340,8 @@ VVV
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_text_glossary_term_inconsistencies(app):
app.build()
# --- glossary term inconsistencies: regression test for #1090
# --- glossary term inconsistencies: regression test for
# https://github.com/sphinx-doc/sphinx/issues/1090
result = (app.outdir / 'glossary_terms_inconsistency.txt').read_text(
encoding='utf8'
)
@ -416,7 +421,8 @@ def test_text_seealso(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_text_figure_captions(app):
app.build()
# --- figure captions: regression test for #940
# --- figure captions: regression test for
# https://github.com/sphinx-doc/sphinx/issues/940
result = (app.outdir / 'figure.txt').read_text(encoding='utf8')
expect = (
'14. I18N WITH FIGURE CAPTION'
@ -462,7 +468,8 @@ def test_text_figure_captions(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_text_rubric(app):
app.build()
# --- rubric: regression test for pull request #190
# --- rubric: regression test for pull request
# https://github.com/sphinx-doc/sphinx/issues/190
result = (app.outdir / 'rubric.txt').read_text(encoding='utf8')
expect = (
'I18N WITH RUBRIC'
@ -514,8 +521,9 @@ def test_text_docfields(app):
def test_text_admonitions(app):
app.build()
# --- admonitions
# #1206: gettext did not translate admonition directive's title
# seealso: https://docutils.sourceforge.io/docs/ref/rst/directives.html#admonitions
# https://github.com/sphinx-doc/sphinx/issues/1206:
# gettext did not translate admonition directive's title
# see https://docutils.sourceforge.io/docs/ref/rst/directives.html#admonitions
result = (app.outdir / 'admonitions.txt').read_text(encoding='utf8')
directives = (
'attention',
@ -533,7 +541,8 @@ def test_text_admonitions(app):
assert d.upper() + ' TITLE' in result
assert d.upper() + ' BODY' in result
# for #4938 `1. ` prefixed admonition title
# https://github.com/sphinx-doc/sphinx/issues/4938
# `1. ` prefixed admonition title
assert '1. ADMONITION TITLE' in result
@ -628,7 +637,9 @@ def test_text_topic(app):
@pytest.mark.test_params(shared_result='test_intl_gettext')
def test_gettext_definition_terms(app):
app.build()
# --- definition terms: regression test for #2198, #2205
# --- definition terms: regression test for
# https://github.com/sphinx-doc/sphinx/issues/2198,
# https://github.com/sphinx-doc/sphinx/issues/2205
expect = read_po(
app.srcdir / _CATALOG_LOCALE / 'LC_MESSAGES' / 'definition_terms.po'
)
@ -643,7 +654,8 @@ def test_gettext_definition_terms(app):
@pytest.mark.test_params(shared_result='test_intl_gettext')
def test_gettext_glossary_terms(app):
app.build()
# --- glossary terms: regression test for #1090
# --- glossary terms: regression test for
# https://github.com/sphinx-doc/sphinx/issues/1090
expect = read_po(app.srcdir / _CATALOG_LOCALE / 'LC_MESSAGES' / 'glossary_terms.po')
actual = read_po(app.outdir / 'glossary_terms.pot')
actual_msg_ids = {msg.id for msg in actual if msg.id} # pyright: ignore[reportUnhashable]
@ -658,7 +670,8 @@ def test_gettext_glossary_terms(app):
@pytest.mark.test_params(shared_result='test_intl_gettext')
def test_gettext_glossary_term_inconsistencies(app):
app.build()
# --- glossary term inconsistencies: regression test for #1090
# --- glossary term inconsistencies: regression test for
# https://github.com/sphinx-doc/sphinx/issues/1090
expect = read_po(
app.srcdir / _CATALOG_LOCALE / 'LC_MESSAGES' / 'glossary_terms_inconsistency.po'
)
@ -995,7 +1008,9 @@ def test_html_meta(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_html_footnotes(app):
app.build()
# --- test for #955 cant-build-html-with-footnotes-when-using
# --- test for
# https://github.com/sphinx-doc/sphinx/issues/955
# cant-build-html-with-footnotes-when-using
# expect no error by build
(app.outdir / 'footnote.html').read_text(encoding='utf8')
@ -1029,7 +1044,8 @@ def test_html_undefined_refs(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_html_index_entries(app):
app.build()
# --- index entries: regression test for #976
# --- index entries: regression test for
# https://github.com/sphinx-doc/sphinx/issues/976
result = (app.outdir / 'genindex.html').read_text(encoding='utf8')
def wrap(tag, keyword):
@ -1158,7 +1174,9 @@ def test_html_rebuild_mo(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_xml_footnotes(app):
app.build()
# --- footnotes: regression test for fix #955, #1176
# --- footnotes: regression test for fix
# https://github.com/sphinx-doc/sphinx/issues/955,
# https://github.com/sphinx-doc/sphinx/issues/1176
et = etree_parse(app.outdir / 'footnote.xml')
secs = et.findall('section')
@ -1180,7 +1198,8 @@ def test_xml_footnotes(app):
['i18n-with-footnote', 'ref'],
)
# check node_id for footnote_references which refer same footnote (refs: #3002)
# check node_id for footnote_references which refer same footnote
# See: https://github.com/sphinx-doc/sphinx/issues/3002
assert para0[0][4].text == para0[0][6].text == '100'
assert para0[0][4].attrib['ids'] != para0[0][6].attrib['ids']
@ -1207,7 +1226,8 @@ def test_xml_footnotes(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_xml_footnote_backlinks(app):
app.build()
# --- footnote backlinks: i18n test for #1058
# --- footnote backlinks: i18n test for
# https://github.com/sphinx-doc/sphinx/issues/1058
et = etree_parse(app.outdir / 'footnote.xml')
secs = et.findall('section')
@ -1231,7 +1251,8 @@ def test_xml_refs_in_python_domain(app):
et = etree_parse(app.outdir / 'refs_python_domain.xml')
secs = et.findall('section')
# regression test for fix #1363
# regression test for fix
# https://github.com/sphinx-doc/sphinx/issues/1363
para0 = secs[0].findall('paragraph')
assert_elem(
para0[0],
@ -1245,7 +1266,8 @@ def test_xml_refs_in_python_domain(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_xml_keep_external_links(app):
app.build()
# --- keep external links: regression test for #1044
# --- keep external links: regression test for
# https://github.com/sphinx-doc/sphinx/issues/1044
et = etree_parse(app.outdir / 'external_links.xml')
secs = et.findall('section')
@ -1313,7 +1335,9 @@ def test_xml_keep_external_links(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_xml_role_xref(app):
app.build()
# --- role xref: regression test for #1090, #1193
# --- role xref: regression test for
# https://github.com/sphinx-doc/sphinx/issues/1090,
# https://github.com/sphinx-doc/sphinx/issues/1193
et = etree_parse(app.outdir / 'role_xref.xml')
sec1, sec2 = et.findall('section')
@ -1400,7 +1424,9 @@ def test_xml_warnings(app):
@pytest.mark.test_params(shared_result='test_intl_basic')
def test_xml_label_targets(app):
app.build()
# --- label targets: regression test for #1193, #1265
# --- label targets: regression test for
# https://github.com/sphinx-doc/sphinx/issues/1193,
# https://github.com/sphinx-doc/sphinx/issues/1265
et = etree_parse(app.outdir / 'label_target.xml')
secs = et.findall('section')

View File

@ -94,7 +94,7 @@ def test_theme_api(app):
def test_nonexistent_theme_settings(tmp_path):
# Check that error occurs with a non-existent theme.toml or theme.conf
# (https://github.com/sphinx-doc/sphinx/issues/11668)
# https://github.com/sphinx-doc/sphinx/issues/11668
with pytest.raises(ThemeError):
_load_theme('', tmp_path)

View File

@ -83,7 +83,7 @@ def test_missing_reference_conditional_pending_xref(app):
freshenv=True,
)
def test_keyboard_hyphen_spaces(app):
"""Regression test for issue 10495, we want no crash."""
# https://github.com/sphinx-doc/sphinx/issues/10495
app.build()
assert 'spanish' in (app.outdir / 'index.html').read_text(encoding='utf8')
assert 'inquisition' in (app.outdir / 'index.html').read_text(encoding='utf8')

View File

@ -889,7 +889,7 @@ def test_isattributedescriptor():
try:
# _testcapi module cannot be importable in some distro
# refs: https://github.com/sphinx-doc/sphinx/issues/9868
# See: https://github.com/sphinx-doc/sphinx/issues/9868
import _testcapi # type: ignore[import-not-found]
# instancemethod (C-API)

View File

@ -78,7 +78,8 @@ def test_ambiguous_definition_warning(app):
def _multiple_defs_notice_for(entity: str) -> str:
return f'contains multiple definitions for {entity}'
# was warning-level; reduced to info-level - see https://github.com/sphinx-doc/sphinx/issues/12613
# was warning-level; reduced to info-level
# See: https://github.com/sphinx-doc/sphinx/issues/12613
mult_defs_a, mult_defs_b = (
_multiple_defs_notice_for('std:term:a'),
_multiple_defs_notice_for('std:term:b'),

View File

@ -169,7 +169,7 @@ def test_extract_messages_without_rawsource():
For example: recommonmark-0.2.0 doesn't set rawsource to `paragraph` node.
refs #1994: Fall back to node's astext() during i18n message extraction.
See https://github.com/sphinx-doc/sphinx/pull/1994
"""
p = nodes.paragraph()
p.append(nodes.Text('test'))
@ -252,7 +252,7 @@ def test_split_explicit_target(title, expected):
def test_apply_source_workaround_literal_block_no_source():
"""Regression test for #11091.
"""Regression test for https://github.com/sphinx-doc/sphinx/issues/11091.
Test that apply_source_workaround doesn't raise.
"""

View File

@ -28,10 +28,11 @@ CERT_FILE: Final[str] = str(TESTS_ROOT / 'certs' / 'cert.pem')
class HttpServerThread(Thread):
def __init__(self, handler: type[BaseRequestHandler], *, port: int = 0) -> None:
"""Constructs a threaded HTTP server. The default port number of ``0``
delegates selection of a port number to bind to to Python.
"""Constructs a threaded HTTP server.
Ref: https://docs.python.org/3.11/library/socketserver.html#asynchronous-mixins
The default port number of ``0`` delegates selection of a port number
to bind to Python.
See: https://docs.python.org/3/library/socketserver.html#asynchronous-mixins
"""
super().__init__(daemon=True)
self.server = ThreadingHTTPServer(('localhost', port), handler)