Skip to content
SPECIFICTION
Get listed

Fantomas vs Scalafmt

Fantomas

fsprojects.github.io

Scalafmt

scalameta.org

Side by side

FigureFantomasScalafmt
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WebYes—
WindowsYesYes
macOSYesYes
LinuxYesYes
Self-hosted—Yes
Plans published11
Spec score · Code Formatting Tools8.0 (#9)7.6 (#22)
ConfigurationA limited set of formatting options can be stored in `.editorconfig` and read automatically by the command line tool.Formatting options are set in a plain text .scalafmt.conf file using HOCON syntax.
Editor integrationsThe maker provides setup guides for JetBrains Rider, Visual Studio Code, and Visual Studio.The documentation describes use with IntelliJ, VS Code, Vim, NeoVim, Emacs, Sublime Text, and Eclipse, with Metals supporting formatting requests from editors.
PurposeFantomas is an opinionated formatter for F# source code that formats files based on configuration.Scalafmt is a code formatter for Scala that formats code consistently across a team.

Plans

Fantomas

  • FantomasFree

Fantomas pricing →

Scalafmt

  • FreeFree

Scalafmt pricing →

In their own words

Fantomas

Fantomas formats F# source code according to configuration, using default rules based on Microsoft’s F# style guide. Settings are also available for G-Research conventions. It runs as a .NET tool, and local installation is recommended when a repository needs to keep a fixed version. The command line accepts folders or files with `.fs`, `.fsi`, `.fsx`, `.ml` or `.mli` extensions; source files are expected to parse with the F# compiler before formatting. A limited selection of options can be placed in `.editorconfig` for automatic use by the command-line tool. For continuous integration checks, `dotnet fantomas check` reports formatting drift and exits with a failure code when files need formatting. Setup guides are available for JetBrains Rider, Visual Studio Code and Visual Studio, and the official site links to an online tool for trying the formatter and its settings. Fantomas and its library are available under the Apache 2.0 license. The project is described as an fsprojects incubation project. It is free and open source, with web access listed alongside Linux, macOS and Windows.

Visit fsprojects.github.io

Scalafmt

Scalafmt is a free Scala code formatter for keeping formatting consistent across a team. It handles Scala 2, Scala 3, sbt files and Scala scripts, with one dialect selected for each file. Formatting options are stored in a plain-text .scalafmt.conf file using HOCON syntax. Since version 3.1.0, the configuration must explicitly specify both the version and runner.dialect. Scalafmt can run from an editor, build tool or terminal. Documented editor integrations include IntelliJ, VS Code, Vim, NeoVim, Emacs, Sublime Text and Eclipse; Metals supports formatting requests from editors. It integrates with sbt and documents integrations for Maven, Gradle and Mill. Command-line check and test modes report misformatted code without writing changes. It also supports ignoring files, changed-lines formatting and a library API. IntelliJ range formatting uses IntelliJ’s own formatter by default: Scalafmt is designed primarily for whole files, and selected ranges may produce undesirable results. The project license is Apache-2.0.

Visit scalameta.org