Skip to content

Tests: check the parser, --help, the README table and the docs name the same flags - #69

Merged
tmashara merged 2 commits into
mainfrom
claude/issue-55-docs-flags
Oct 29, 2026
Merged

tmashara merged 2 commits into
mainfrom
claude/issue-55-docs-flags

Conversation

@tmashara

@tmashara tmashara commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

What / why

A renamed or added flag could leave --help, the README table, or the docs naming flags that don't exist, or a flag nobody documented. Until now the only check was a hardcoded list of 25 flags that --help had to contain, and every flag PR had to append to it. This PR replaces that list with one test that checks itself.

What it checks

One unit test, the parser, --help and the docs name the same flags in tests/unit/cli-args.test.ts:

  • parser → --help: every v === "--x" branch in src/cli.ts (read as text, since the parser has no list to export) appears somewhere in --help. This is the "new flag nobody documented" case, and it includes report's --verdict/--title, which sit in the usage line.
  • --help → parser: every flag under Options is one the parser takes. If the parser's v === "--x" style is ever refactored, this direction fails loudly, never silently.
  • README table = Options: the flags in the first column of | Argument or flag | match --help's Options exactly.
  • Docs ⊆ --help: every --flag in README.md, docs/**/*.md and skills/**/*.md is named in --help. Allowlist: --immutable only (yarn install --immutable in docs/case-study.md).

helpOptions(help) goes in tests/helpers/parse.ts, alongside the other output parsers, as CONTRIBUTING asks. It cuts each Options entry at its first 2+ space gap, so flags mentioned in descriptions aren't counted. It handles -h, --help, the paired --left-…, --right-… lines and --sitemap[=<url>].

Doc fix

skills/renderdiff/reference.md: --left-/--right-storage-state is now --left-storage-state/--right-storage-state, a flag an agent can actually run. The paragraph is reflowed to fit.

How tested

Every mismatch is collected and reported in one failure, one line each, and the real tree passes:

  • --dry-run → --dryrun in skills/renderdiff/SKILL.md: skills/renderdiff/SKILL.md names --dryrun, which --help doesn't
  • --computed → --computer in the help text only: the parser takes --computed, --help doesn't name it
  • --computed → --computer in the parser only: the parser takes --computer, --help doesn't name it
  • the --mask-media README row deleted: --help lists --mask-media, the README table doesn't

npm run typecheck, lint, format:check, npm test (302 pass) and npm run test:visual (332 pass) all pass. Built on #67's tip, whose tree is identical to current main.

Skipped: a relative-link check (add it when a broken link ships) and action.yml (its script is mostly npm/curl/playwright flags).

Fixes #55

🤖 Generated with Claude Code

tmashara and others added 2 commits October 29, 2026 18:00
…he same flags

Replaces the hardcoded --help flag list. Spells out --left-storage-state in the skill
reference, the one doc flag --help didn't name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmashara
tmashara merged commit 59cd884 into main Oct 29, 2026
3 checks passed
@tmashara
tmashara deleted the claude/issue-55-docs-flags branch October 29, 2026 17:09
@tmashara tmashara mentioned this pull request Oct 29, 2026
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.

Test that every flag in the docs exists in the CLI, and back

1 participant