Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

lightbend-labs/scala-rewrites

Scalafix Rewrites for Scala

lightbend-labs/scala-rewrites.json
{
"createdAt": "2019-05-01T16:14:34Z",
"defaultBranch": "main",
"description": "Scalafix Rewrites for Scala",
"fullName": "lightbend-labs/scala-rewrites",
"homepage": "",
"language": "Scala",
"name": "scala-rewrites",
"pushedAt": "2025-01-27T22:04:27Z",
"stargazersCount": 47,
"topics": [],
"updatedAt": "2025-02-24T22:41:48Z",
"url": "https://github.com/lightbend-labs/scala-rewrites"
}

Add the sbt-scalafix sbt plugin, with the SemanticDB compiler plugin enabled ([official docs][1]):

project/plugins.sbt
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.0")
build.sbt
inThisBuild(List(
semanticdbEnabled := true,
semanticdbOptions += "-P:semanticdb:synthetics:on", // make sure to add this
semanticdbVersion := scalafixSemanticdb.revision,
scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value),
))

Then run the desired rewrite(s) ([official docs][2]), in sbt:

> scalafixAll dependency:fix.scala213.ExplicitNonNullaryApply@org.scala-lang:scala-rewrites:<version>

You can also add the following to your build.sbt:

ThisBuild / scalafixDependencies += "org.scala-lang" %% "scala-rewrites" % "<version>"

and then:

> scalafixAll fix.scala213.ExplicitNonNullaryApply

[1] !: https://scalacenter.github.io/scalafix/docs/users/installation.html [2] !: https://scalacenter.github.io/scalafix/docs/rules/external-rules.html

To develop/contribute to any of the rewrites

Section titled “To develop/contribute to any of the rewrites”
sbt ~tests/test
# edit rewrites/src/main/scala/...