Skip to content

Commit 116f605

Browse files
committed
updates docs/conf.py to handle sphinx warnings
1 parent 9323cf9 commit 116f605

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

  • packages/google-cloud-apiregistry/docs

packages/google-cloud-apiregistry/docs/conf.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# All configuration values have a default; values that are commented out
2626
# serve to show the default.
2727

28+
import logging
2829
import os
2930
import shlex
3031
import sys
@@ -383,3 +384,22 @@
383384
napoleon_use_ivar = False
384385
napoleon_use_param = True
385386
napoleon_use_rtype = True
387+
388+
389+
# --- Specific Warning Filters not covered by SuppressedWarnings ---
390+
class UnexpectedUnindentFilter(logging.Filter):
391+
"""Filter out warnings about unexpected unindentation."""
392+
393+
def filter(self, record):
394+
# Return False to suppress the warning, True to allow it
395+
msg = record.getMessage()
396+
if "Bullet list ends without a blank line" in msg:
397+
return False
398+
return True
399+
400+
401+
def setup(app):
402+
# Sphinx's logger is hierarchical. Adding the filter to the
403+
# root 'sphinx' logger will catch warnings from all sub-loggers.
404+
logger = logging.getLogger("sphinx")
405+
logger.addFilter(UnexpectedUnindentFilter())

0 commit comments

Comments
 (0)