Synopsis
affogato format [-chq] [--strict] [--indent=N] [--width=N] [FILE…]
Description
Format Nix files in place, as nixfmt does.
Options
- -c, --check
-
Write nothing, and fail if a file would change.
- -h, --help
-
Show this help and exit.
- --indent=N
-
Indent by N spaces (default: 2).
- -q, --quiet
-
Print only errors, not the files rewritten and the summary.
- --strict
-
Depend less on how the input was laid out.
- --width=N
-
Fit lines in N columns where possible (default: 100).
Arguments
- [FILE…]
-
Files to rewrite, or directories to search for .nix files; standard input to standard output without any.
Exit status
- 0
-
Every file was processed.
- 1
-
A file cannot be read or does not parse, or would change under --check.
- 2
-
The command line is invalid.
Files
Files are read as UTF-8, and one that is not is refused. A file is written only when its content changes. A file that fails is reported on standard error, and the other files are still processed. Each file rewritten is named on standard error, then a count of the files changed, unchanged and failed, and the time taken.
This follows the treefmt formatter spec:
https://treefmt.com/latest/reference/formatter-spec/