Scalafix

Scalafix

  • User guide
  • Developer guide
  • Browse sources
  • GitHub

›Rules

Usage

  • Installation
  • Configuration
  • Suppressing rules

Rules

  • Built-in rules
  • DisableSyntax
  • ExplicitResultTypes
  • LeakingImplicitClassVal
  • NoAutoTupling
  • NoValInForComprehension
  • OrganizeImports
  • ProcedureSyntax
  • RedundantSyntax
  • RemoveUnused
  • Using external rules
  • Community rules

Misc

  • Related projects
Edit

Using external rules

There have been growing number of scalafix rules published by Scalafix users.

Users can leverage such published rules by following steps.

One method is to run rule dynamically with the following sbt command.

// sbt shell
> scalafix dependency:RULE@GROUP::ARTIFACT:VERSION

Each parts stands for the following.

  • RULE: A name of rule to be performed.
  • @GROUP::ARTIFACT:VERSION: An id to specify a dependency containing rules.

To permanently install the rule for a build, users can add the dependency to build.sbt by updating ThisBuild / scalafixDependencies.

// build.sbt
ThisBuild / scalafixDependencies +=
  "GROUP" %% "ARTIFACT" % "VERSION"
// sbt shell
> scalafix RULE

You may find useful scalafix rules in Scaladex.

If you want to create and publish scalafix rules, refer "Developer guide" section.

← RemoveUnusedCommunity rules →
Scalafix
Docs
Get startedRulesExtend Scalafix
Community
Chat on DiscordDiscuss on Scala Users
More
GitHub
Copyright © 2025 Scala Center