Skip to content

Commit

Permalink
Add ref.any as a warning sub-type (#12739)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
  • Loading branch information
simaoafonso-pwt and AA-Turner authored Jan 27, 2025
1 parent 705c1be commit 60f88cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Features added
* #13065: Enable colour by default in when running on CI.
Patch by Adam Turner.
* Allow supressing warnings from the :rst:dir:`toctree` directive when a glob
pattern doesn't match any documents, via the new ``toc.glob_not_matching``
pattern doesn't match any documents, via the new ``toc.empty_glob``
warning sub-type.
Patch by Slawek Figiel.
* #9732: Add the new ``autodoc.mock_objects`` warnings sub-type.
* #9732: Add the new ``autodoc.mocked_object`` warnings sub-type.
Patch by Cyril Roelandt.
* #7630, #4824: autodoc: Use :file:`.pyi` type stub files
to auto-document native modules.
Expand All @@ -70,6 +70,9 @@ Features added
which defaults to ``True`` for backwards compatibility.
The default will change to ``False`` in Sphinx 10.
Patch by Adam Turner.
* #9732: Add the new ``ref.any`` warnings sub-type
to allow suppressing the ambiguous 'any' cross-reference warning.
Patch by Simão Afonso and Adam Turner.

Bugs fixed
----------
Expand Down
4 changes: 4 additions & 0 deletions doc/usage/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,7 @@ Options for warning control
* ``misc.copy_overwrite``
* ``misc.highlighting_failure``
* ``ref.citation``
* ``ref.any``
* ``ref.doc``
* ``ref.footnote``
* ``ref.keyword``
Expand Down Expand Up @@ -1487,6 +1488,9 @@ Options for warning control
.. versionadded:: 8.2
Added ``autodoc.mocked_object``

.. versionadded:: 8.2
Added ``ref.any``


Builder options
===============
Expand Down
2 changes: 2 additions & 0 deletions sphinx/transforms/post_transforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ def stringify(name: str, node: Element) -> str:
target,
candidates,
location=node,
type='ref',
subtype='any',
)
res_role, newnode = results[0]
# Override "any" class with the actual role type to get the styling
Expand Down

0 comments on commit 60f88cc

Please sign in to comment.