[RFC PATCH v2 29/35] docs/qapi-domain: warn when QAPI domain xrefs fail to resolve

John Snow posted 35 patches 1 month, 2 weeks ago
[RFC PATCH v2 29/35] docs/qapi-domain: warn when QAPI domain xrefs fail to resolve
Posted by John Snow 1 month, 2 weeks ago
Ignore the built-in JSON doc types, but warn about anything else. This
is primarily here to assert that the cross-referencing system is
complete and accurate, and that any cross-references the transmogrifier
generates are correctly marked as visible and rendered/indexed by the
qapi-domain.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 docs/sphinx/qapi-domain.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/docs/sphinx/qapi-domain.py b/docs/sphinx/qapi-domain.py
index 907ba6d27d3..8dbf0ee5e70 100644
--- a/docs/sphinx/qapi-domain.py
+++ b/docs/sphinx/qapi-domain.py
@@ -1060,6 +1060,16 @@ def resolve_xref(
         multiple_matches = len(matches) > 1
 
         if not matches:
+            if target not in (
+                "string",
+                "number",
+                "int",
+                "boolean",
+                "null",
+                "value",
+                "q_empty",
+            ):
+                print(f"!QXREF: {type=} {target=}")
             return None
         elif multiple_matches:
             logger.warning(
-- 
2.47.0