Skip to content

Commit

Permalink
sbt-scalafix now runs with 2.13 unless it is against 2.12 sources
Browse files Browse the repository at this point in the history
  • Loading branch information
bjaglin committed May 1, 2024
1 parent 8bde76c commit 41f9c75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/users/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Great! You are all set to use Scalafix with sbt :)
| `scalafixDependencies` | `SettingKey[Seq[ModuleID]]` | Dependencies making [custom rules](#run-custom-rules) available via their simple name. Can be set in `ThisBuild` or at project-level. Defaults to `Nil`.
| `scalafixOnCompile` | `SettingKey[Boolean]` | When `true`, Scalafix rule(s) declared in `scalafixConfig` are run on compilation, applying rewrites and failing on lint errors. Defaults to `false`.
| `scalafixResolvers` | `SettingKey[Seq[Repository]]` | Custom resolvers where `scalafixDependencies` are resolved from, in addition to the user-defined sbt `ThisBuild / resolvers`. Must be set in `ThisBuild`. Defaults to: Ivy2 local, Maven Central, Sonatype releases & Sonatype snapshots.
| `scalafixScalaBinaryVersion` | `SettingKey[String]` | Scala binary version used for Scalafix execution. Can be set in `ThisBuild` or at project-level. Defaults to 2.12. For advanced rules such as ExplicitResultTypes to work, it must match the binary version defined in the build for compiling sources. Note that `scalafixDependencies` artifacts must be published against that Scala version.
| `scalafixScalaBinaryVersion` | `SettingKey[String]` | Scala binary version used for Scalafix execution. Can be set in `ThisBuild` or at project-level. Defaults to 2.12 for 2.12 projects, 2.13 otherwise. For advanced rules such as ExplicitResultTypes to work, it must match the binary version defined in the build for compiling sources. Note that `scalafixDependencies` artifacts must be published against that Scala version.
### Main and test sources
Expand Down
5 changes: 2 additions & 3 deletions project/ScalafixBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
}

val prevVersions = previousVersions(sv).map(prev => TargetAxis(prev))
val scala3FromScala2 = TargetAxis(scala3)
val xsource3 = TargetAxis(sv, xsource3 = true)

(prevVersions :+ scala3FromScala2 :+ xsource3).map((sv, _))
}
(prevVersions :+ xsource3).map((sv, _))
} :+ (scala213, TargetAxis(scala3))

lazy val publishLocalTransitive =
taskKey[Unit]("Run publishLocal on this project and its dependencies")
Expand Down

0 comments on commit 41f9c75

Please sign in to comment.