repost schema fmt rewrites .repost files into the canonical format: two-space indentation, aligned field types, and aligned attributes. Formatting is idempotent, and every example in these docs is fmt output.
Usage#
repost schema fmt [path] [options]The optional path is a .repost file or a directory of them; with none, the discovered schema is formatted.
Options#
| Option | Description |
|---|---|
--check | Don't write. Exit 1 if any file is not already formatted. |
Behavior and exit codes#
In normal mode, files are rewritten and the command exits 0 whether or not anything changed; only a file with syntax errors makes it exit 1, after printing could not format `<file>`: it has syntax errors. In --check mode, any file that would change prints would reformat: <path> and the command exits 1 with <n> file(s) are not formatted, leaving every file untouched.
Examples#
repost schema fmtFormatted 1 file(s):
repost/schema.repostIn CI:
repost schema fmt --checkAll 1 file(s) already formatted.