Reviews are about the code
Indentation, line breaks and spacing are decided once, by the tool. Pull requests go back to discussing what the code does.
Fantomas is an opinionated formatter for F#. It follows the F# style guide, runs as a dotnet tool, and checks your code in CI. Once it is in place, nobody talks about whitespace again.
Install Fantomas as a local dotnet tool and format a folder.
$ dotnet tool install fantomas --create-manifest-if-needed
$ dotnet fantomas src
To try the next major version before it ships, ask for a prerelease.
$ dotnet tool install fantomas --prerelease
Your editor picks the tool up from there. See the setup for Rider, VS Code and Visual Studio, or read the full getting started guide.
Indentation, line breaks and spacing are decided once, by the tool. Pull requests go back to discussing what the code does.
Every file is formatted the same way on every machine, so a diff never mixes a real change with someone's editor settings.
dotnet fantomas check fails the build when a file drifts, so formatting stays
fixed without anyone having to remember.
An agent writes F# faster than it reasons about layout. Let it run Fantomas after every edit
and its code arrives in the house style, with no review round about whitespace. The
--json report tells it exactly what to fix.
The defaults follow the F# style guide from Microsoft. A handful of settings switch to the G-Research conventions.
It's like playing jazz.
As a maintainer, Fantomas makes it easy to contribute to my projects. I no longer have to care about spacing or style, Fantomas handles it for me.
Not only does it eliminate the duty for code formatting during typing, but it also integrates into the CI pipeline and automatically checks the formatting for you.
Using Fantomas on a project people know? Add your logo.