Skip to content

writ check

Validate a writ file.

Terminal window
writ check <file>

The command validates the file against the schema. The command needs no network connection and no API key, so you can run it in continuous integration.

Flag Purpose
--explain Show the effective writ, with each default value applied.

When the file is correct, the command prints one line:

bug-fixer.yaml: valid

When the file has a problem, the command prints one line for each problem. The line gives the path of the field, the severity, and the message:

bug-fixer.yaml:/grants/0: error: exactly one grant is required
Severity Result
error The file is not valid. The exit code is 2.
warning The file is valid, and something needs your attention.

A reserved field gives a warning. Read about reserved fields.

The --explain flag shows the terms that apply, with each default value:

Terminal window
writ check bug-fixer.yaml --explain

Use this flag to see the bounds that you did not write. A writ with no bounds field still has bounds, and --explain shows them.

The command takes exactly one file. To validate more than one file, use a loop:

- name: Validate the writs
run: |
for file in writs/*.yaml; do
writ check "$file"
done
Code Meaning
0 The file is valid.
2 The file is not valid.