Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow suppressing a warning of non-matching glob pattern in TOC #13230

Merged
merged 8 commits into from
Jan 16, 2025

Conversation

fivitti
Copy link
Contributor

@fivitti fivitti commented Jan 10, 2025

Purpose

Some documentation files are created dynamically in my project. They are included in TOC by the glob pattern. The number of included files varies and may be zero.

I have enabled the --fail-on-warning that I found very helpful in improving the quality of my documentation. However, it interrupts the documentation build when the glob pattern matches no entries in any TOC, which is not an error in my project.

Unfortunately, the related warning has no subtype specified, and it cannot be suppressed using the suppress_warnings list.

References

No references. I haven't created an issue.

AUTHORS.rst Outdated
@@ -106,6 +106,7 @@ Contributors
* Vince Salvino -- JavaScript search improvements
* Will Maier -- directory HTML builder
* Zac Hatfield-Dodds -- doctest reporting improvements, intersphinx performance
* Slawek Figiel -- additional warning suppression
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort your name alphabetically in the list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, done.

CHANGES.rst Outdated
Comment on lines 39 to 40
* Add a subtype ``toc.glob_not_matching`` to a warning of a non-matching glob
pattern in TOC.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe why the change is being made, rather than what it does

Suggested change
* Add a subtype ``toc.glob_not_matching`` to a warning of a non-matching glob
pattern in TOC.
* 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I've rephrased the sentence a bit.

@@ -1397,6 +1397,7 @@ Options for warning control
* ``toc.no_title``
* ``toc.not_readable``
* ``toc.secnum``
* ``toc.glob_not_matching``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps?

Suggested change
* ``toc.glob_not_matching``
* ``toc.empty_glob``

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I've applied your suggestion.

Comment on lines 1450 to 1452
.. versionadded:: 8.2
Added ``duplicate_declaration.c`` and ``duplicate_declaration.cpp``.

Added ``duplicate_declaration.c`` and ``duplicate_declaration.cpp``, and
``toc.glob_not_matching``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this into a new versionadded directive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@AA-Turner AA-Turner added this to the 8.2.0 milestone Jan 10, 2025
@fivitti fivitti requested a review from AA-Turner January 13, 2025 09:59
@fivitti
Copy link
Contributor Author

fivitti commented Jan 16, 2025

I've rebased it on the current master.

CHANGES.rst Outdated Show resolved Hide resolved
doc/usage/configuration.rst Outdated Show resolved Hide resolved
doc/usage/configuration.rst Outdated Show resolved Hide resolved
CHANGES.rst Outdated Show resolved Hide resolved
@AA-Turner AA-Turner merged commit 67f6154 into sphinx-doc:master Jan 16, 2025
22 checks passed
@AA-Turner
Copy link
Member

Thank you!

A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants