nkb lint
Check a pack file against the rules of the pack format, and report every problem in one pass.
nkb lint <file.toml> [--json] [--explain]
What does it check?
Everything the pack format asks of a file, from its encoding to the sentence that says what each value breaks. A value without that sentence is an error, because it is the reason a catalogue is worth more than a list. The text around the values is read by people too, so it may hold only characters you can see, with no line breaks, direction marks or terminal escape sequences, and it has a length limit: 120 characters for a name, 300 for a description and 1000 for what a value breaks or what should happen. Every run says how many of the format’s rules this build checks, and --explain lists every rule and why the few it does not check wait.
Examples
A file that passes:
$ nkb lint my-pack.toml
0 errors, 0 warnings.
Checked 43 of 49 rules, 1 of them only in part. 5 not checked - run `nkb lint --explain` to see which and why.
The pack format is not frozen yet: a later release may still change it.
A value that says nothing about what it breaks:
$ nkb lint my-pack.toml
my-pack.toml:38 E030 value `trailing-space` declares no `breaks`. It is the field this catalogue exists for: say what this value usually breaks and why, or the value is a curiosity rather than a test case.
1 error, 0 warnings.
Write your own pack shows the most common errors, each with what nkb lint says and how to fix it.
The same verdict for a pipeline, with --json, and nothing else on standard output:
$ nkb lint my-pack.toml --json
{
"schema": 1,
"tool_version": "0.4.0",
"pack_format": 1,
"format_frozen": false,
"accepted": false,
Is the format final?
Not yet. A later release may still change it, and its notes will say how. nkb lint says so on every run, so that a file passing today is not read as a promise about tomorrow.
Options
Exit codes
| Code | Meaning |
|---|---|
0 | the pack passed every rule this build checks |
1 | the pack broke at least one blocking rule |
2 | the command was called wrongly |
3 | there is no pack file to read at that path |
5 | the file is there and could not be read, or the verdict could not be written to standard output |
The help, as the program prints it
What nkb lint --help prints, from nkb 0.4.0.
nkb lint - check a pack file against the format rules
Usage:
nkb lint <file.toml> [--json] [--explain]
Options:
--json Write the verdict as JSON, and nothing else
--explain List every rule and whether this build checks it
-h, --help Show this help and exit with 0
Exit codes:
0 the pack passed every rule this build checks
1 the pack broke at least one blocking rule
2 the command was called wrongly
3 there is no pack file to read at that path
5 the file is there and could not be read, or the verdict
could not be written to standard output