Skip to content

fix: the commands reference and the parser agree - #1371

Open
gennaroprota wants to merge 3 commits into
cppalliance:developfrom
gennaroprota:fix/see_also_and_list_item_aliases_keep_their_text
Open

gennaroprota wants to merge 3 commits into
cppalliance:developfrom
gennaroprota:fix/see_also_and_list_item_aliases_keep_their_text

Conversation

@gennaroprota

Copy link
Copy Markdown
Collaborator

The commands reference listed @sa and @arg as aliases of @see and @li, but the parser ignored both and dropped their text. It also listed three forms that don't work: @link ... @endlink (Clang closes @link only at @/link, so the rest of the comment becomes a code block), @strong (not a command) and @ref <name> "text" (the quoted text is printed literally). Nothing caught this, because utils/docs/check_commands_registry.py, meant to keep the registry and the parser in sync, never ran in CI and no longer matched the registry's shape. Found while writing the Doxygen compatibility page for #1342.

Changes

  • Source: @sa is handled like @see, and @arg like @li.
  • Golden tests: new javadoc/see/sa (XML and AsciiDoc, showing the See Also section) and javadoc/lists/arg fixtures.
  • CI: ci-utility-tests.yml runs the registry check, with its checks updated to the registry's current shape and a new one requiring every @ command a registry syntax names to be one the parser handles.

Testing

The new fixtures pin both aliases, and the CI step fails whenever the registry documents a command the parser ignores, or the parser handles a command the registry doesn't document.

Documentation

The commands registry, from which the commands reference is generated, drops the three false forms (the Cross-reference entry points @link users to @ref <name>), adds @dot, @msc and @startuml, which the parser already renders as code blocks, and gives the Footnote Definition and Math Block entries their examples.

The commands reference documents `@sa` as an alias of `@see` and `@arg`
as an alias of `@li`, but the doc-comment extractor handled neither.
Clang gives each of them its own command ID, which reached the branch
that ignores unhandled block commands, so the paragraph after the
command disappeared without a warning. We now handle them in the same
`case` as `@see` and `@li`.
…ence

The commands registry, from which the commands reference is generated,
documented three forms that don't work. `@link <name> ... @endlink` is a
verbatim block in Clang's command table that only HeaderDoc's `@/link`
closes, so everything after `@link` becomes a code block. `@strong` is
not a command, so `@strong word` renders as the text "strong word". And
the quoted text in `@ref <name> "text"` is printed literally after the
link. We now document none of them, and the Cross-reference entry says
to write `@ref <name>` in place of `@link`.

The registry also gains `@dot`, `@msc` and `@startuml`, which the parser
already renders as code blocks, and the Footnote Definition and Math
Block entries now point to the examples that already show them.
utils/docs/check_commands_registry.py is meant to keep the commands
registry in sync with the doc-comment parser, but no CI job ran it, and
it had fallen out of step with the registry: it still expected the
`node_types` and `preview` fields and the example locations of an
earlier layout, and failed with 181 problems, nearly all of them false.
We now run it in the utility tests job, with its checks updated to the
registry's current shape.

It also checked only one direction, that every command the parser
handles is documented, which let the registry document `@sa`, `@arg`,
`@strong` and `@link` while the parser ignored them. It now also checks
that every command a documented syntax names is one the parser handles.
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.21%. Comparing base (9faf2d7) to head (33d988f).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1371   +/-   ##
========================================
  Coverage    83.21%   83.21%           
========================================
  Files           35       35           
  Lines         3670     3670           
  Branches       845      845           
========================================
  Hits          3054     3054           
  Misses         410      410           
  Partials       206      206           
Flag Coverage Δ
bootstrap 83.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cppalliance-bot

Copy link
Copy Markdown

An automated preview of the documentation is available at https://1371.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-10-30 11:10:19 UTC

@github-actions

Copy link
Copy Markdown
Contributor

✨ Highlights

  • 🧪 New golden tests added

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🥇 Golden Tests 54% 499 499 - 6 6 - - -
🧰 Tooling 42% 389 239 150 1 - 1 - -
📄 Docs 3% 30 15 15 1 - 1 - -
⚙️ CI <1% 3 3 - 1 - 1 - -
🛠️ Source <1% 2 2 - 1 - 1 - -
Total 100% 923 758 165 10 6 4 - -

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • utils/docs/check_commands_registry.py (Tooling): 389 lines Δ (+239 / -150)
  • tests/golden/fixtures/javadoc/see/sa.xml (Golden Tests): 211 lines Δ (+211 / -0)
  • tests/golden/fixtures/javadoc/lists/arg.xml (Golden Tests): 156 lines Δ (+156 / -0)

Generated by 🚫 dangerJS against 33d988f

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants