OC

ocamlformat

ocamlformat and dune-based formatting for OCaml projects

Details

Language / Topic
ocamlOCaml
Category
Linter / Formatter

Rules

balanced
- Use `ocamlformat` with a `.ocamlformat` configuration file at the project root — run `dune fmt` to apply formatting.
- Add `(lint (action (run ocamlformat --check %{pp-flags} %{impl})))` to `dune` files or run `dune fmt --check` in CI.
- Pin `ocamlformat` version in `opam` or the `dune-project` file to prevent formatting drift between developer machines.
- Use `profile = ocamlformat` in `.ocamlformat` for the default profile, adjusting `break-cases = fit` for compact match expressions.