midad check
midad check <file.md|dir> [--json]
Type-checks a program, lints it, audits the permissions it asks for and checks the shape of the project. It runs nothing.
$ midad check hello.md
hello.md: ok
A directory with a midad.toml checks from its entry file:
$ midad check .
What it checks
- Types and names: every expression, every call, every return path.
- Permissions: a call whose target is not granted is
E0300, a route withoutlistenisE0303,persistwithout both file grants isE0304,static:without anfs_readgrant that covers the directory it serves isE0305. - Structure: a route outside
routes/, a file underroutes/with no route, two files with one module name. - Imports: cycles, missing files, aliases, and blocks that would be dropped.
- Lints: naming,
/where integer division looks intended, an unusedfn-parameter function.
Warnings are printed and do not change the exit code.
--json
$ midad check hello.md --json
prints one object with ok, command, files, diagnostics and summary.
Every diagnostic has all ten fields, with null where a field does not apply.
The shape is documented in errors and diagnostics.
Exit codes
0 for no errors, 1 for at least one error, 2 when the command itself was
wrong. --json changes what is printed, not the exit code.