fmt

Format .repost files in place, or check formatting in CI with --check.

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

OptionDescription
--checkDon'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 fmt
Formatted 1 file(s):
  repost/schema.repost

In CI:

repost schema fmt --check
All 1 file(s) already formatted.

Continue