Format MiniZinc files
# Print formatted source to stdout.zincite fmt model.mzn
# Check files or a directory without changing them.zincite fmt --check model.mzn data.dznzincite fmt --check models/
# Format explicit files in place.zincite fmt --write model.mzn data.dznWith no input argument, or with -, the formatter reads stdin. Multiple files
require --check or --write; directories support --check only. Directory
checks include hidden and Git-ignored .mzn and .dzn files and skip .git.
See the formatting style gallery for the settled layout rules and reproducible examples.
Syntax or formatting-directive errors leave the affected file untouched.
--write preserves file permissions and refuses symlinks. Other independent
files are still processed when one fails.
Format an editor buffer
Section titled “Format an editor buffer”Use the format-on-save recipe for stdin invocation, buffer replacement and failure handling. The support page describes the current interactive acceptance limit.
Configuration
Section titled “Configuration”The formatter reads .editorconfig files. For example:
root = true
[*.{mzn,dzn}]indent_style = spaceindent_size = 4max_line_length = 120end_of_line = lfinsert_final_newline = trueIt also supports tab_width, trim_trailing_whitespace and charset (utf-8
or utf-8-bom). Set max_line_length = off to disable width-based wrapping.
Comments, literal contents and skipped regions retain their original text.
Command-line options override EditorConfig:
zincite fmt --indent-size 2 --max-line-length 80 model.mznRun zincite fmt --help (or zincite-fmt --help) for all options.
Keeping layout unchanged
Section titled “Keeping layout unchanged”Use the formatting directive examples to preserve a complete item or region. The formatter reference defines protected ranges and invalid marker placement.
See the command reference for exit codes and the formatter library reference for Rust use.