writ check
Validate a writ file.
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. |
Output
Section titled “Output”When the file is correct, the command prints one line:
bug-fixer.yaml: validWhen 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 requiredSeverity
Section titled “Severity”| 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.
Explain the writ
Section titled “Explain the writ”The --explain flag shows the terms that apply, with each default value:
writ check bug-fixer.yaml --explainUse this flag to see the bounds that you did not write. A writ with no
bounds field still has bounds, and --explain shows them.
Use the command in continuous integration
Section titled “Use the command in continuous integration”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" doneExit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | The file is valid. |
| 2 | The file is not valid. |