Skip to content

Commit

Permalink
Merge pull request #300 from bjaglin/reset
Browse files Browse the repository at this point in the history
scalafixEnable: preserve versions set by ++
  • Loading branch information
bjaglin committed Apr 15, 2022
2 parents eaacbba + 2f01689 commit 787958b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/scalafix/sbt/ScalafixEnable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ object ScalafixEnable {
scalacOptionsSettings ++ enableSemanticdbPlugin
)
} yield settings
extracted.appendWithoutSession(settings, s)
extracted.appendWithSession(settings, s)
}
}
7 changes: 6 additions & 1 deletion src/sbt-test/sbt-scalafix/scalafixEnable/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ lazy val scala212 = project.settings(
// 2.13.x is supported
lazy val scala213 = project.settings(
// semanticdb-scalac_2.13.4 available in 4.4.10, became available as of 4.4.0
scalaVersion := "2.13.4"
scalaVersion := "2.13.4",
crossScalaVersions := Seq("2.12.15")
)

TaskKey[Unit]("check") := {
Expand Down Expand Up @@ -68,3 +69,7 @@ TaskKey[Unit]("check") := {
.count(_ == "-Yrangepos") == 1
)
}

TaskKey[Unit]("checkVersion") := {
assert((scala213 / scalaVersion).value == "2.12.15")
}
8 changes: 7 additions & 1 deletion src/sbt-test/sbt-scalafix/scalafixEnable/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@

-> scala212/test:compile
> scala212/scalafixAll RemoveUnused
> scala212/test:compile
> scala212/test:compile

-> checkVersion
> ++2.12.15 -v
> checkVersion
> scalafixEnable
> checkVersion

0 comments on commit 787958b

Please sign in to comment.