Skip to content

Commit ec0dcd2

Browse files
authored
sphinxdocs: make Any and object types no-ops to avoid missing xrefs (#2905)
The "Any" and "object" types are useful in expression starlark types, but aren't actually real things. Treat them like None and make them no-ops so they aren't treated like missing xrefs.
1 parent 945e464 commit ec0dcd2

File tree

1 file changed

+5
-0
lines changed
  • sphinxdocs/src/sphinx_bzl

1 file changed

+5
-0
lines changed

sphinxdocs/src/sphinx_bzl/bzl.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,11 @@ def _on_missing_reference(app, env: environment.BuildEnvironment, node, contnode
17661766
# There's no Bazel docs for None, so prevent missing xrefs warning
17671767
if node["reftarget"] == "None":
17681768
return contnode
1769+
1770+
# Any and object are just conventions from Python, but useful for
1771+
# indicating what something is in Starlark, so treat them specially.
1772+
if node["reftarget"] in ("Any", "object"):
1773+
return contnode
17691774
return None
17701775

17711776

0 commit comments

Comments
 (0)