Skip to content

Feat/schema generation#1178

Open
gennaroprota wants to merge 5 commits intocppalliance:developfrom
gennaroprota:feat/schema_generation
Open

Feat/schema generation#1178
gennaroprota wants to merge 5 commits intocppalliance:developfrom
gennaroprota:feat/schema_generation

Conversation

@gennaroprota
Copy link
Copy Markdown
Collaborator

No description provided.

Add a --schemas[=<dir>] option that writes a JSON Schema file
(mrdocs-dom-schema.json) describing every object and field available to
Handlebars templates. The schema is derived from the same compile-time
reflection metadata used by MapReflectedType.hpp, so it stays in sync
with the code automatically.

The option requires no config file or source files — it writes the
schema and exits immediately.
OperatorKind was the only enum serialized as a raw integer. All other
enums serialize as human-readable strings. Change tag_invoke to use
getOperatorName, consistent with the rest.
--schemas now writes both mrdocs-dom-schema.json (Handlebars DOM) and
mrdocs.rnc (XML output). The XML schema mirrors XMLWriter.cpp's
serialization.
…ClassKind

Replace manual toString and tag_invoke overloads with
MRDOCS_DESCRIBE_ENUM for four enums whose kebab-case names match the
existing string representations.

The XML writer now emits these fields (e.g. <access>public</access>,
<constexpr>constexpr</constexpr>) where they were previously silently
skipped. None/none sentinel values are suppressed via a generic
has_none_enumerator check.

TypeKind stays manual because toKebabCase("LValueReference") produces
"l-value-reference", not the established "lvalue-reference".
… --schemas

This guarantees the RELAX NG schema stays in sync with the C++ type
definitions. Every CI run now validates all golden test XML files
against a schema derived from the same reflection metadata that produces
the XML.
@github-actions
Copy link
Copy Markdown

🚧 Danger.js checks for MrDocs are experimental; expect some rough edges while we tune the rules.

⚠️ Warnings

Warning

PR description looks empty. Please add a short rationale and testing notes.

✨ Highlights

  • 🧪 Existing golden tests changed (behavior likely shifted)

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🥇 Golden Tests 40% 1853 1672 181 169 - 169 - -
🛠️ Source 33% 1530 1375 155 18 3 15 - -
🏗️ Build 21% 964 11 953 2 - 1 - 1
🧪 Unit Tests 7% 326 326 - 1 1 - - -
🔧 Toolchain <1% 12 10 2 2 - 2 - -
🔧 Toolchain Tests <1% 2 1 1 1 - 1 - -
Total 100% 4687 3395 1292 193 4 188 - 1

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

🔝 Top Files

  • mrdocs.rnc (Build): 949 lines Δ (+0 / -949)
  • include/mrdocs/Schemas/RncSchemaWriter.hpp (Source): 646 lines Δ (+646 / -0)
  • include/mrdocs/Schemas/DomSchemaWriter.hpp (Source): 456 lines Δ (+456 / -0)

Generated by 🚫 dangerJS against 34c59cf

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.90%. Comparing base (0246935) to head (34c59cf).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1178      +/-   ##
===========================================
+ Coverage    78.85%   81.90%   +3.04%     
===========================================
  Files          308       33     -275     
  Lines        32157     2984   -29173     
  Branches      6456      691    -5765     
===========================================
- Hits         25359     2444   -22915     
+ Misses        4436      373    -4063     
+ Partials      2362      167    -2195     
Flag Coverage Δ
bootstrap 81.90% <100.00%> (+<0.01%) ⬆️
cpp ?

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

☔ View full report in Codecov by Sentry.
📢 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://1178.mrdocs.prtest2.cppalliance.org/index.html

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

2026-04-16 15:14:08 UTC

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