Freedom report

Two barsScore 5.6

  • Free tierNo free tier on record
  • Open codeNo open-source code on record
  • Runs widely3 of 6 device platforms
  • DocumentedPlans, terms and facts published

Scalafix is a free Scala refactoring and linting tool for code-health work and one-time migrations. It can report patterns associated with production bugs or style violations, and teams can enforce rules during code review; its check option fails when linting or fixes are needed. Syntactic rules operate on 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. Developers can create custom lint and rewrite rules through its public API. The official build integration is for sbt, whose plugin can run rules across project configurations and main and test sources. Documentation also lists externally maintained integrations for scala-cli, Mill, Gradle, Maven, and Mega-Linter; Mega-Linter supports only built-in syntactic rules. Scalafix is tested on macOS, Linux, and Windows, with listed tested Scala versions 2.12.21, 2.13.18, and 3.9.0 LTS. It is no longer published for Scala 2.11 or sbt 0.13.x.

Who it is for

Scalafix suits Scala developers and teams that want automated linting, refactoring, or migration rules in their projects and code review process. Users of semantic rules need compiled sources and SemanticDB enabled.

What is good

  • Free tool for Scala refactoring and linting.
  • Syntactic rules do not require compilation.
  • Supports custom lint and rewrite rules.
  • Can enforce checks during code review.
  • Tested on macOS, Linux, and Windows.

What to know first

  • No longer published for Scala 2.11.
  • sbt-scalafix is no longer published for sbt 0.13.x.
  • Semantic rules require SemanticDB-compiled sources.
  • Mega-Linter integration supports only built-in syntactic rules.

Verdict

Scalafix offers rule-based linting and rewrites for Scala, with both syntactic and semantic approaches. Check the Scala and build-tool version limits, and the additional setup required for semantic rules.

Compared on code refactoring tools

Free plan
Yes
Supported languages
Scala 2.12, Scala 2.13, Scala 3
Refactoring scope
project
Batch refactoring
Yes
AST-based analysis
Yes
Deployment
desktop

Best Scalafix alternatives

See all 20