Allow suppressing warnings for non-matching `toctree` glob patterns (#13230)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
Slawomir Figiel 2025-01-16 19:17:21 +01:00 committed by GitHub
parent 099b91a9d9
commit 67f6154be3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 0 deletions

View File

@ -96,6 +96,7 @@ Contributors
* \A. Rafey Khan -- improved intersphinx typing
* Roland Meister -- epub builder
* Sebastian Wiesner -- image handling, distutils support
* Slawek Figiel -- additional warning suppression
* Stefan Seefeld -- toctree improvements
* Stefan van der Walt -- autosummary extension
* \T. Powers -- HTML output improvements

View File

@ -46,6 +46,10 @@ Features added
Patch by Adam Turner.
* #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``
warning sub-type.
Patch by Slawek Figiel.
Bugs fixed
----------

View File

@ -1393,6 +1393,7 @@ Options for warning control
* ``misc.copy_overwrite``
* ``misc.highlighting_failure``
* ``toc.circular``
* ``toc.empty_glob``
* ``toc.excluded``
* ``toc.no_title``
* ``toc.not_readable``
@ -1449,6 +1450,8 @@ Options for warning control
.. versionadded:: 8.2
Added ``duplicate_declaration.c`` and ``duplicate_declaration.cpp``.
.. versionadded:: 8.2
Added ``toc.empty_glob``.
Builder options
===============

View File

@ -120,6 +120,7 @@ class TocTree(SphinxDirective):
__("toctree glob pattern %r didn't match any documents"),
entry,
location=toctree,
subtype='empty_glob',
)
for docname in doc_names: