Generate the reference from the header, and check that it is one - #10
Merged
Merged
Conversation
The scorecard item asks for a generated API reference published with the
release rather than written by hand beside it. This is that, and most of
the work was in the header: Doxygen only reads /** and /*!, and every
comment in zu.hpp was written as /*, so a generator run over it produced
a reference with 355 undocumented members in it.
The comments that document a declaration are now /**, and the rest are
left alone. Section dividers are not doc comments and would arrive as
the description of whatever came next, and a remark inside a function
body has nothing to attach to.
Where the header documents an overload set once, the group stays one
comment. DISTRIBUTE_GROUP_DOC hands the first comment in a ///@{ block
to every member of it, which is how the try_ half of each class is
documented: it is the same call as the one above it answering a failure
rather than throwing, and saying so sixty times is how prose comes to
disagree with itself. Two comments had been written inside a function
body, where nothing reads them, and are now above the function.
The check is the part worth reading. Doxygen exits 0, with no warnings
and no pages, on a header it extracted nothing from, and
WARN_IF_UNDOCUMENTED cannot fire when there is nothing there to be
undocumented. That is not hypothetical: a ZU_HPP left in PREDEFINED
defined this header's own include guard, the preprocessor dropped the
whole file, and the run was green and empty. So docs/reference.py reads
the header a second time and by different means, greps the types it
declares at namespace scope, and fails when the reference does not have
them. Both failures are exercised: with the guard back in PREDEFINED it
reports all 27 types missing and names the cause, and with one field's
comment turned back into a plain /* it reports that field.
ZU_CPP_DOCS is off even at top level, unlike tests, examples and
benchmarks. Doxygen is not needed to build this header or to use it, and
a contributor with a compiler and nothing else should be able to
configure the repository. CI turns it on, and so does the release, which
builds the reference from the tag and attaches it rather than keeping a
directory of generated HTML in the tree.
No engine is needed for any of it. The reference is about the header,
and the header is what this repository owns; zu.h is generated in the
engine's tree and a copy of its reference here would be wrong the day
the generator runs again.
41 tests green, and the reference builds with no warnings of any kind
over 61 pages.
tamnd
added a commit
to tamnd/zu
that referenced
this pull request
Aug 23, 2026
tamnd/zu-c#10 generates the reference from include/zu.hpp and publishes it with the release rather than keeping a copy in the tree. The item is held on the check rather than on the output. Doxygen exits 0, with no warnings and no pages, on a header it extracted nothing from, so a gate that is only "the generator was quiet" passes over an empty reference. It did, for a day: an include guard left in PREDEFINED made the preprocessor drop the whole header. The client's check reads the header a second time and by different means and fails when the types it declares are not in what came out. Practice goes 67 to 78 over a denominator of 90, which is the tier's 100 less the api-map and perf weights zu-c does not owe. install and stability are what is left.
22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
referenceitem on zu-c's scorecard: a generated API reference, published with the release rather than written by hand beside it.Most of the work was in the header. Doxygen only reads
/**and/*!, and every comment inzu.hppwas written as/*, so a generator run over it produced a reference with 355 undocumented members in it. The comments that document a declaration are now/**and the rest are left alone: a section divider is not a doc comment and would arrive as the description of whatever came after it, and a remark inside a function body has nothing to attach to. Two comments had been written inside a body, where nothing reads them, and are now above the function they belong to.Where the header documents an overload set once, it still does.
DISTRIBUTE_GROUP_DOChands the first comment in a///@{block to every member of the block, which is what fits this header's authoring style: thetry_half of each class is the same call as the one above it answering a failure rather than throwing, and it carries no prose of its own on purpose, so that it cannot drift from the throwing half. Writing sixty comments that restate their signatures would have made the reference worse rather than better.The check
This is the part worth reviewing.
Doxygen exits 0, with no warnings and no pages, on a header it extracted nothing from.
WARN_IF_UNDOCUMENTEDcannot fire when there is nothing there to be undocumented, so a gate that is only "Doxygen was quiet" passes over an empty reference.That is not hypothetical. A
ZU_HPPleft inPREDEFINEDwhile this was being built defined the header's own include guard, so#ifndef ZU_HPPwas false, the preprocessor dropped the whole file, and the run was green with nothing in it. The Doxyfile now carries a comment saying never to put it back.So
docs/reference.pyreads the header a second time and by different means. It greps the typeszu.hppdeclares at namespace scope, parses the XML Doxygen wrote, and fails when the first list is not covered by the second. One grep and one parser disagreeing is what an empty reference looks like from the outside.Both failures were exercised rather than reasoned about. With the include guard back in
PREDEFINED:And with one field's comment turned back into a plain
/*:Building it
Off by default, unlike tests, examples and benchmarks. Doxygen is not needed to build this header or to use it, and a contributor with a compiler and nothing else should be able to configure the repository.
No engine is needed for any of it, which is why the CI job is thirty seconds rather than ten minutes. The reference is about the header, and the header is what this repository owns.
zu.his generated in the engine's tree and is not here, so a reference for the C API belongs where the C API is written rather than as a second copy that drifts the day the generator runs again.release.ymlbuilds the reference from the tag, runs the same check over it, and attaches it to the release, so there is no directory of generated HTML in the tree and no copy anybody has to remember to regenerate.Checked
On a Linux box with the engine at HEAD:
readme/suite over the two blocks this PR adds to the page.