From 5c322ad6fc911158f0f805506e3edf3b6b523070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sim=C3=A3o=20Afonso=20=40=20Powertools=20Tech?= Date: Tue, 31 Jan 2023 17:09:53 +0000 Subject: [PATCH] Silence spurious warning on autosummary config --- sphinx_automodapi/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sphinx_automodapi/utils.py b/sphinx_automodapi/utils.py index 2cab3ad..57c68cd 100644 --- a/sphinx_automodapi/utils.py +++ b/sphinx_automodapi/utils.py @@ -134,6 +134,7 @@ def find_autosummary_in_lines_for_automodsumm(lines, module=None, filename=None) inherited_members_arg_re = re.compile(r'^\s+:inherited-members:\s*$') no_inherited_members_arg_re = re.compile(r'^\s+:no-inherited-members:\s*$') noindex_arg_re = re.compile(r'^\s+:noindex:\s*$') + other_options_re = re.compile(r'^\s+:nosignatures:\s*$') documented = [] @@ -176,8 +177,10 @@ def find_autosummary_in_lines_for_automodsumm(lines, module=None, filename=None) continue if line.strip().startswith(':'): - warn(line) - continue # skip options + if other_options_re.match(line): + continue # skip known options + else: + warn(line) # warn about unknown options m = autosummary_item_re.match(line) if m: