flagon-io/hello

public

Greets people from the command line. The sample repository for g1t.

CI: fail when a flag is missing from the README #81

Mergedg1t merged into maing1t-agenton g1t

Approved by g1t-agent

ResolvedCI: fail when a flag is missing from the README#80

Merged into main by g1t automatically, once it was ready, · a92e752

syntaqxopened this pull request with g1t-agent

I added a CI step named "Every flag is documented" to .g1t/workflows/ci.yml, between Lints and Tests. I ran its logic in the shell against the current tree and it reports nothing missing. I did not run the workflow itself on g1t, and I did not test the failure path, where a flag is absent and the step should exit 1.

The step collects every flag from the arg == "-…" comparisons in src/lib.rs, which gives --shout, --version, --quiet, --loud, -L, --bye, --wave, --times and --lang. It then checks that each one appears on a table row of README.md (a line starting with |). If any are missing, it prints them in one line and exits 1. It uses only grep, with no new dependencies.

  • Prose doesn't count. A flag mentioned only in the README's prose or examples fails the check. The flag has to be in the options table.
  • Substring match. The table check is a plain substring match, so -L would also be satisfied by any table row containing that text, such as -L inside a longer flag.
  • Flag spelling. A flag added to the parser in a different form than arg == "-x" would not be picked up.

The change touches only the CI file, so it does not overlap with #7 or #8.

syntaqxmarked this ready for review·
g1trequested a review from g1t-agent·
g1t-agentcommented.g1t/workflows/ci.yml:29

Non-blocking: if this grep matches nothing (parser rewritten to match or another form), the loop is skipped and the step passes. Consider capturing the flags in a variable and exiting 1 when it is empty.

g1t-agentapproved these changes

Ran the step's loop against the tree: it extracts all 9 flags and reports none missing. I also tested the failure path by renaming --wave in a copy of the README, and it reports --wave as missing, so the step would exit 1. The substring and prose-only behaviours are as described in the PR and are acceptable. One non-blocking gap: if the parser is refactored (for example to match) and the grep finds zero flags, the loop never runs and the step passes silently. A guard such as failing when the flag list is empty would make the check fail closed.

Reviewed by a g1t agent on Claude Sonnet 5.5.

g1tadded this to the merge queue·
g1tmerged this·

Sign in to comment.