ci: S23.22 assert every platform class carries its registry token - #729
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe platform documentation checker now validates that platform interface classes use ChangesPlatform class-prefix validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/check_platform_docs.py`:
- Around line 263-280: Align all validator descriptions with the accepted-prefix
contract: in scripts/check_platform_docs.py lines 263-280, update prefix_faults
diagnostics to mention the registry token or an approved alternate prefix;
update the module contract at lines 28-31 and the class report at lines 349-355
to describe accepted prefixes. Update .github/workflows/ci.yml lines 780-782 to
document the same rule.
- Line 272: Update the accepted list construction in the relevant platform-docs
checking logic to use iterable unpacking: preserve token as the first element
and expand CLASS_PREFIXES.get(token, []) directly in the list, without changing
the resulting values.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a785acc9-f072-412f-933c-eb8cfca2c640
📒 Files selected for processing (3)
.github/workflows/ci.ymldocs/NAMING.mdscripts/check_platform_docs.py
The prefix_faults docstring stated the token-only rule in the one place that accepts a second-upstream prefix. Iterable unpacking for both alias lists, so the file spells the idiom one way (Ruff RUF005). Part of #708
☀️ Quality Summary Created by Quality Monitor v4.15.0 (#82d77af). More details are shown in the GitHub Checks Result. |
Purpose
docs/NAMING.mdstates that every public class inPlatform/<Token>/Interface/isnamed
SolidSyslog<RegistryToken><Thing>, and nothing asserted it. That is how thenaming drifted far enough to need the rename in #721 — the rule existed, but only
review was holding it.
The check was handed to the #711 branch by that rename PR and was crowded out by the
review rounds. This closes it.
Part of #708
Change Description
scripts/check_platform_docs.pygains a third boundary alongside the two it alreadyholds. Every header in a registered platform's
Interface/directory must beginSolidSyslog<Token>.Two decisions worth stating:
CLASS_PREFIXESmap, not the existingALIASESmap. The handoverproposed reusing
ALIASESsoSolidSyslogWinsock*passes. It would work, butALIASESis prose vocabulary — it carries"Posix": ["POSIX"]and"MbedTls": ["Mbed TLS", "mbedTLS", "mbedtls"], so reusing it would makeSolidSyslogPOSIXFile.ha legal declaration, which is the spellingNAMING.mdexists to prevent. A separate map keeps the second-upstream allowance a deliberate
edit.
Winsockis its only entry;Win32is inALIASESfor prose but no classuses it, so it is not granted here.
*Errors.hheaders are checked too, where the handover scoped the rule tonon-
*Errors.hones. An errors header takes its name from its class and so carriesthe token by construction, which makes including it free — and it catches one that
outlives or never had a parent.
NAMING.mdgains the third gate in the list that maps each rule to the tool holdingit; that list claimed a clean split between two tools and would otherwise now be
incomplete. The rule itself is unchanged and stays where it was.
Also extracts
interface_headers(), since the new check andvocabulary()werelisting the same directory two ways.
Test Evidence
Every platform conforms today, so the check passes on a clean tree — which proves
nothing on its own. It was verified by injecting each fault in turn and restoring:
Platform/Posix/Interface/SolidSyslogGetAddrInfoResolver.h— a class named for the upstream callPlatform/Posix/Interface/SolidSyslogPOSIXFile.h— a prose alias used as an identifier prefixCLASS_PREFIXESemptiedSolidSyslogWinsock*header — the allowance is load-bearing, not decorativeGates run locally:
check_platform_docs.py(10 platforms, 12 roles), 76 hook tests inthe pinned image,
mkdocs build --strict, markdownlint over all 62 files. No Cchanged, so no build or MISRA renumbering was needed.
Areas Affected
scripts/check_platform_docs.py, thedocs-buildCI lane comment, and one bullet indocs/NAMING.md. No production code, no build files. Adding a platform now requiresits classes to carry its token, which every platform already does.
Summary by CodeRabbit
Documentation
Chores