Skip to main content
Version: Next

--check gates

Five commands that write files take --check: each writes nothing and exits with 1 if anything would change. Run them in a pipeline to fail a pull request that leaves part of the repository behind.

The gates​

CommandExits with 1 when
kq fmt --checkA .kq file is not in canonical form
kq build --checkA .g.kq file would change: a change was committed without the build that goes with it
kq prune --checkA .g.kq file holds orphaned derived elements or Ids
kq arrange --checkThe model is not in the conventional layout; it lists what would be created, rewritten, renamed or deleted
kq materialize --checkThe repository still names a preset, which kq materialize would write out as a policy set of its own

The last two fit only some repositories:

  • kq arrange --check fails until kq arrange has run once, since that first run marks the repository arranged. From then on, kq build and kq validate report every departure from the layout as an error of their own, so the gate adds nothing to them.
  • kq materialize --check fails for as long as the repository names a preset, as one kq init makes does. Use it only where you have written the baseline out and want no preset to come back. Checking a written-out set is checking a policy set you write, which comes with a paid seat, Paid; a preset is free.

Run them​

Run the gates beside kq validate, from the repository root:

kq validate models/my-model # fails if the model breaks a rule
kq build --check models/my-model # fails if someone forgot to build, or the model breaks a rule
kq fmt --check models/my-model # fails if a file is not formatted
kq prune --check models/my-model # fails if there are orphans

A gate that fails says what it would write. kq fmt --check, on a file whose layout is off, prints after its banner:

would format models/my-model/model/my-model.kq
1 file(s) would be reformatted

kq build --check, on a change committed without its build, prints would rewrite models/my-model/model/my-model.g.kq, then the model's policy findings. Each exits with 1. Run the command without --check to make the change, and commit what it wrote.

Two flags for kq validate​

  • --strict fails on a lint as well as an error.
  • --require-license fails with exit 3 where a policy set needs a feature no license grants, instead of skipping it with a warning, so a pipeline never passes on rules it did not check. kq build and kq audit take it too.

See The kq command line for every command's exit codes.

© 2026 Extenza Works. All rights reserved.