Documentation
¶
Overview ¶
Command docsgen keeps the command table in docs/cli.md in sync with the CLI's own command table (internal/cli/cli.go).
It renders the table by calling the CLI the way a user would — `idea help --format=md` — capturing the stdout writer it is handed, and splices the result between the generated-block markers in docs/cli.md. Prose outside the markers is never touched.
go run ./internal/docsgen # rewrite docs/cli.md go run ./internal/docsgen -check # fail if it is out of date go run ./internal/docsgen -api-check # fail if docs/openapi.yaml has drifted
`make docs`, `make docs-check` and `make api-check` are the intended entry points; CI runs the latter two so neither a new command nor a new HTTP route can ship undocumented. The API half lives in apicheck.go.
The spec's own version number, which no guard has ever read.
docs/openapi.yaml has said `version: 0.1.0` since the file was created -- `git log -L '/^info:/,+5:docs/openapi.yaml'` returns exactly one commit. It did not move for v0.2.0 or v0.3.0, while the spec itself gained response codes, schemas, properties and an enum. docs/api-reference-hosting.md carries the instruction "Bump `info.version` when you tag", in a document nobody reads at tag time, and three consecutive tags missed it. That is what an unowned manual step looks like, and the remedy for an unowned manual step is not a louder instruction.
Two checks, because they catch different things and one of them can run far earlier than the other:
Staleness (every push). `info.version` must be at least the newest released heading in CHANGELOG.md. This never predicts the next version -- it only refuses a spec that describes a release already superseded -- so it runs beside the other guards on every push. Against this tree's history it would have gone red the first push after v0.2.0 shipped, four rounds before a tag-time check could have fired.
Exactness (tag time). `info.version` must equal the tag being built. This is the only thing that catches "bumped to 0.4.0, tagged v0.5.0". It fires late, but before goreleaser publishes anything.