You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
harden(branding-lint): clap-aware sub-rule to catch /// doc-comment leaks before they reach --help #75
The allowlist-style branding lint (#67) has a known weakness: the rustdoc-comment mention (///) rule accepts ALL /// lines because hundreds of legitimate project-name mentions exist. The trade-off: NEW user-visible RTK phrasings in clap /// doc comments (which become --help output) silently pass the lint and only fail via FORBIDDEN_TOKENS if the exact phrasing already lives in the regression-pin list.
This is how RTK savings, RTK adoption, RTK equivalent, RTK artifacts, RTK and native (v0.1.7 round-3 sweep) all reached production before being caught.
Goal
Add a clap-aware sub-rule to `tests/branding_lint.rs` that scans `///` lines immediately preceding clap macros — `#[derive(Parser)]`, `#[command(...)]`, `#[arg(...)]`, `#[clap(...)]`, struct fields used as clap targets — and rejects case-insensitive `\brtk\b` unless the line is explicitly allowlisted with `// branding-lint: allow legacy`.
Detection heuristic
A `///` line N is "clap-doc-adjacent" if any of:
Line N+k (for k=1..3, skipping blank lines and other `///` lines) starts with `#[` and contains `Parser`, `Subcommand`, `Args`, `ValueEnum`, `arg(`, `command(`, `clap(`
Or: walk forward to the next non-`///` non-blank line; if it's a `#[arg]` / `#[command]` / `pub fn` inside an `impl` block on a clap-derived struct, the doc comment leaks to `--help`.
Definition of done
New `branding_lint_clap_doc_comments_fail_on_rtk` test in `tests/branding_lint.rs`
Audit existing clap docs in `src/` for current violations; fix them all (rebrand to `ContextCrawler` equivalent) before merging
Confirm test fails on a synthetic `/// RTK foo\n#[arg(long)]` fixture (sanity self-test in the test itself, like the existing `leak_simulations` block)
`cargo test --test branding_lint` passes on the branch
Why
v0.1.8 → v0.1.9 cycle had 3 user-report-triggered hotfix rounds for clap-help leaks. This closes the source instead of adding one FORBIDDEN_TOKENS row per discovered leak.
Activity
harden(branding-lint): clap-aware sub-rule for /// doc-comment RTK le…