Repository navigation
docs: check the CLI and IDL references against their sources - #28
Merged
Merged
Conversation
The CLI reference and the IDL guide restate what source owns, in prose
deliberately richer than clap's help strings or a token list — so neither
is generated. Two scripts instead check the surfaces still name the same
things, which is the part that rots silently.
scripts/check-cli-drift.py parses `comline --help` and every subcommand's,
and compares commands and long flags against the page in both directions.
It found three real gaps, fixed here:
- `comline targets` was entirely undocumented.
- `generate --external-std` was missing.
- `--verbose` was never named, only `-v`/`-vv`/`-vvv`.
Documenting `targets` also corrected the claim that `completions` is the
only command writing to stdout.
scripts/check-idl-drift.py reads core's `rust_sitter` grammar leaves (36
keywords) and checks the guide documents each. A keyword counts only
inside a code fence or inline code span: searching prose for bare words
matches English ("the type of a field"), while backticked-only search
misses keywords that appear just in examples — that first pass reported
nine keywords, all false positives. `import` is excluded with its reason
(legacy, superseded by `use`). The `config.idp` grammar is left out until
`reference/congregation/config-id.md` is written, since it would report
`false` as undocumented every run and an always-red check gets ignored.
CI: IDL drift runs per relevant PR (a source fetch, no Rust), kept out of
the Docs workflow so it cannot block a Pages deploy; CLI drift runs weekly
since it needs a cargo build, caching the binary on the CLI's commit.
Both resolve the default branch rather than assuming it — `core` is on
`master`, `cli` on `main`.
Also replaces the plain-text `comline-typescript#6, #7` in the runtime
repo-structure record with live PR state badges.
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.
The CLI reference and the IDL guide restate what source owns, in prose deliberately richer than clap's help strings or a token list — so neither page is generated. Two scripts instead check that the surfaces still name the same things, which is the part that rots silently.
scripts/check-cli-drift.pyParses
comline --helpand every subcommand's, comparing commands and long flags against the page in both directions. It found three real gaps, fixed here:comline targetswas entirely undocumented — a whole command missing from the table.generate --external-stdwas missing.--verbosewas never named, only-v/-vv/-vvv, so searching the long form found nothing.Documenting
targetsalso corrected a nearby claim thatcompletionsis the only command writing to stdout.It scans
_data/*.yamlalongside the markdown — it has to, since moving the Global flags table into YAML made the page unparseable to a text-based checker (that showed up as--quiet/--plainfalse positives on the first run).scripts/check-idl-drift.pyReads core's
rust_sittergrammar leaves (36 keywords) and checks the guide documents each. No Rust build — the grammar is a source file, read from a checkout or fetched.A keyword counts as documented only inside a code fence or inline code span. Both halves matter: searching prose for bare words matches ordinary English ("the type of a field", "a package depends on"), while backticked-only search misses keywords appearing just in examples. A first pass using the latter reported nine undocumented keywords — all nine false positives.
importis excluded with its reason recorded (the grammar marks it legacy, superseded byuse). Theconfig.idpgrammar is deliberately not checked yet:reference/congregation/config-id.mdis still an empty stub, so it would reportfalseas undocumented every run, and an always-red check is one people learn to ignore.CI
Both resolve the target repo's default branch via the API rather than assuming one —
coreis onmaster,clionmain, and assumingmainfor core 404'd.Also replaces the plain-text
comline-typescript#6, #7in the runtime repo-structure record with live PR-state badges, and fills in the auto-documentation proposal with a full definition of what the feature is (an optional tool documenting a user's schemas and packages, with the CAS supplying per-version docs and a generated changelog) plus its open questions.Test plan
poetry run zensical build --strict— cleancomline0.2.0 and core's grammarpipefailtrap in both workflows: a pipeline returnstee's status, soif !would never fire withoutshell: bash— demonstrated failing and passing--obsolete-flagcore/master