Repository navigation
Tests: check the parser, --help, the README table and the docs name the same flags - #69
Merged
Merged
Conversation
…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>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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--helphad 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 flagsintests/unit/cli-args.test.ts:--help: everyv === "--x"branch insrc/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 includesreport's--verdict/--title, which sit in the usage line.--help→ parser: every flag under Options is one the parser takes. If the parser'sv === "--x"style is ever refactored, this direction fails loudly, never silently.| Argument or flag |match--help's Options exactly.--help: every--flaginREADME.md,docs/**/*.mdandskills/**/*.mdis named in--help. Allowlist:--immutableonly (yarn install --immutableindocs/case-study.md).helpOptions(help)goes intests/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-stateis 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→--dryruninskills/renderdiff/SKILL.md:skills/renderdiff/SKILL.md names --dryrun, which --help doesn't--computed→--computerin the help text only:the parser takes --computed, --help doesn't name it--computed→--computerin the parser only:the parser takes --computer, --help doesn't name it--mask-mediaREADME row deleted:--help lists --mask-media, the README table doesn'tnpm run typecheck,lint,format:check,npm test(302 pass) andnpm 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