Formatter
Usage
bash
cleat fmt -w . # format all .cleat files in place cleat fmt -check . # check formatting (CI mode) cleat fmt main.cleat # print formatted output to stdout cleat fmt - < input.cleat # format stdin to stdout
Canonical style
The formatter enforces consistent indentation (4 spaces), spacing, and trailing commas. It handles all Cleat syntax including struct literals, match expressions, agent/guard/server declarations, and string interpolation.
Atomic writes
When using -w, the formatter writes to a temp file and renames — the original is never in a half-written state.
CI integration
bash
cleat fmt -check . # Exit 0: all files formatted # Exit 1: some files need formatting (prints their paths)