Scalafix
scalacenter.github.io
- Free plan
- Windows
- macOS
- Linux
What Scalafix is
Scalafix is a free tool for refactoring and linting Scala projects. It can flag code patterns associated with production bugs or style violations, automate routine code-health work, and handle one-time migrations. Teams can apply rules during code review; its check option fails when fixes or linting are needed. Syntactic rules inspect source code without compilation, while semantic rules need compiled sources with the SemanticDB compiler plugin enabled. Built-in rules include OrganizeImports, RemoveUnused, DisableSyntax, ProcedureSyntax, and RedundantSyntax, and developers can create custom lint and rewrite rules through the public API. The official build integration is for sbt, while the documentation also lists externally maintained integrations for scala-cli, Mill, Gradle, Maven, and Mega-Linter. That Mega-Linter integration supports only built-in syntactic rules. Scalafix is tested on Linux, macOS, and Windows. Its listed tested Scala versions are 2.12.21, 2.13.18, and 3.9.0 LTS; it is no longer published for Scala 2.11. It is associated with the Scala Center, an independent not-for-profit center established at EPFL.
Who it suits
Scalafix suits Scala developers who want repeatable linting, refactoring, or migration workflows, including teams enforcing rules in code review. Semantic-rule users need compiled sources and the SemanticDB compiler plugin.
Good to know, and what to watch
- Automates routine code-health tasks and migrations.
- Check mode can fail when fixes are needed.
- Supports custom lint and rewrite rules.
- Tested on Linux, macOS, and Windows.
- Semantic rules require SemanticDB-enabled compiled sources.
- Mega-Linter supports only built-in syntactic rules.
- No longer published for Scala 2.11.
- sbt-scalafix is no longer published for sbt 0.13.x.
The verdict
Scalafix combines linting, automated rewrites, and migration support for Scala projects, with both built-in and custom rules. Check compatibility with the Scala version, build tool, and rule type you plan to use.
What the maker publishes
- Build integration
- The official sbt plugin supports running rules across project configurations and main and test sources. source
- Build tools
- The documentation describes sbt support and lists externally maintained integrations for scala-cli, Mill, Gradle, Maven, and Mega-Linter. source
- Built-in rules
- Built-in rules include OrganizeImports, RemoveUnused, DisableSyntax, ProcedureSyntax, and RedundantSyntax. source
- Built-in rules
- The built-in rule list includes RemoveUnused, OrganizeImports, ExplicitResultTypes, and DisableSyntax. source
- CI
- Scalafix can enforce refactoring and linting rules during code review. source
- CI enforcement
- Scalafix can enforce refactoring and linting rules on code reviews, and its --check option fails when fixes or linting are needed. source
- Community support
- The project links to community discussion on Discord and Scala Users. source
- Custom rules
- Developers can write custom linter and rewrite rules using Scalafix’s public API. source
- Custom rules
- Users can create custom linter and rewrite rules using the Scalafix public API. source
- Founded
- 2016 source
- Headquarters
- Lausanne, Switzerland source
- Linting
- It reports code patterns that can cause production bugs or violate coding style. source
- Linting
- It reports errors for code patterns that can cause production bugs or violate coding style. source
- Maker
- The Scala Center describes itself as an independent not-for-profit center established at EPFL and focused on open source and education. source
- Maker
- The project site identifies Scala Center in its copyright notice. source
- Mega-Linter limit
- The Mega-Linter integration supports only built-in syntactic rules. source
- Other build tools
- The documentation lists externally maintained support for scala-cli, Mill, Gradle, Maven, and Mega-Linter; Mega-Linter supports only built-in syntactic rules. source
- Purpose
- Scalafix is a refactoring and linting tool for Scala that automates code health tasks and one-time migrations. source
- Purpose
- Scalafix is a refactoring and linting tool for Scala. source
- Refactoring
- It can automate day-to-day code health tasks and one-time migration scripts. source
- Rule types
- Syntactic rules run on source code without compilation, while semantic rules require compiled sources with the SemanticDB compiler plugin enabled. source
- Rule types
- It supports syntactic rules that can run without compilation and semantic rules that require SemanticDB compiler output. source
- Scala support
- The installation guide lists Scala 2.12.21, 2.13.18, and 3.9.0 LTS as tested versions and says Scalafix is no longer published for Scala 2.11. source
- Semantic rule requirement
- Semantic rules require source files compiled with SemanticDB, and some rules also require compiler options such as unused-import warnings. source
Checked against the maker's pages on 3 Oct 2026.