2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Warn about statements in grammar not described in docs

Skip over obsolete options.
This commit is contained in:
Petr Špaček
2022-05-12 19:16:52 +02:00
parent 1c6f2c5ad1
commit cbad1803a5

View File

@@ -268,6 +268,29 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
self.log_statement_overlap(new[name], old[name])
old.update(new)
def check_consistency(self):
"""Sphinx API"""
defined_statements = set(
obj["signature"] for obj in self.data["statements"].values()
)
statements_in_grammar = set(self.statement_blocks)
missing_statement_sigs = statements_in_grammar.difference(
defined_statements
)
for missing in missing_statement_sigs:
grammars = self.statement_grammar_groups[missing]
if len(grammars) == 1:
flags = grammars[0][0].subgrammar.get("_flags", [])
if ("obsolete" in flags) or ("test only" in flags):
continue
logger.warning(
"statement %s is defined in %s grammar but is not described"
" using .. statement:: directive",
missing,
domainlabel,
)
@classmethod
def process_statementlist_nodes(cls, app, doctree, fromdocname):
"""