bbatsov/ocamlformat — explained in plain English
Analysis updated 2026-08-15 · repo last pushed 2026-03-31
Format an entire OCaml project with a single Dune command.
Set up a custom formatting profile so code matches your team's preferred style.
Integrate with a code editor via server mode to format files on the fly.
Standardize code style across a team to eliminate formatting debates in code reviews.
| bbatsov/ocamlformat | 000madz000/rfid-attendance | 00kaku/gallery-slider-block | |
|---|---|---|---|
| Language | — | TypeScript | JavaScript |
| Last pushed | 2026-03-31 | 2024-07-22 | 2021-05-19 |
| Maintenance | Maintained | Dormant | Dormant |
| Setup difficulty | moderate | easy | easy |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | developer | general |
Figures from each repo's GitHub metadata at analysis time.
Requires an OCaml toolchain and optionally the Dune build system to be set up in your project.
ocamlformat is a tool that automatically tidies up OCaml source code so developers don't have to argue about how it should look. You run it on a file, and it reformats the code to follow a consistent style, spacing, indentation, line breaks, and so on. This saves teams from debating formatting choices in code reviews and keeps codebases visually consistent. The tool ships with opinionated defaults, meaning it makes formatting decisions for you out of the box. But if you disagree with those choices, you can create a small configuration file in your project to tweak things. There are also three preset "profiles" to choose from: the standard default, one matching the tool's own internal style, and one following conventions from Jane Street, a major OCaml company. Beyond regular code, it can also clean up comments and documentation strings, including code examples embedded in comments. The primary audience is anyone writing OCaml, from individual hobbyists to large engineering teams. For a solo developer, it saves time you'd otherwise spend manually aligning code. For a team, it eliminates a whole category of code review arguments, nobody needs to comment on indentation or spacing because the formatter handles it. It's also designed to integrate into standard OCaml workflows, so if your project uses the Dune build system, formatting your entire project is a single command. One notable design choice is that the tool doesn't just format code but also offers a server mode (called RPC) that other tools can talk to. This means code editors and IDEs can format files on the fly without launching the tool separately each time. The project is officially part of the OCaml Platform, which is the recommended toolset for the language, and it has backing from organizations including Jane Street and Tarides.
An opinionated auto-formatter for OCaml code that enforces consistent spacing, indentation, and line breaks so teams never argue about style in code reviews.
Maintained — commit in last 6 months (last push 2026-03-31).
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.