Skip to content

verdict fmt

Format policy files, check formatting, or write formatted files.

Runs locally. Effects: format output or write files.

ArgumentTypeRequiredDefaultDescription
--write (-w)booleannofalseFormat files in place
--checkbooleannofalseExit non-zero if any file would change (for CI)
<files>positionalnoNo parser defaultFiles to format (reads stdin if none given)

--help (-h) shows command help without executing the command. Boolean flags support --no-<flag>. Defaults stated in descriptions may be resolved by the handler or configuration rather than the argument parser.

File paths, or stdin when no files are supplied. With stdin, —check and —write are ignored and formatted source is printed.

File input: supported. Standard input: supported. The files positional accepts additional terms or paths.

{
"kind": "source",
"description": "Default: policy source. --write: acknowledgements for changed files. --check: stderr diagnostics for changed files, no stdout."
}

Standard output: Default: policy source. —write: acknowledgements for changed files. —check: stderr diagnostics for changed files, no stdout.

Lifecycle: Completes after formatting the supplied input.

  • 0: input was formatted, or all checked files already matched. With no file paths, stdin is formatted regardless of —check or —write.
  • 1: —check found a file whose formatting would change.

Argument, I/O, and other failures handled by the CLI runner use status 1.

verdict fmt policy.vd --check
verdict fmt policy.vd --write