Skip to content

Commit

Permalink
Merge pull request #335 from bjaglin/cantfixoverridenscalac
Browse files Browse the repository at this point in the history
overriden scalacOptions are not supported by scalafixEnable
  • Loading branch information
bjaglin authored Jan 30, 2023
2 parents 9b81b76 + 785d92d commit 5fd9592
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ object FatalWarningsPlugin extends AutoPlugin {
override def requires: Plugins = ScalafixPlugin

override def projectSettings: Seq[Def.Setting[_]] = Seq(
Test / compile / scalacOptions := {
val old = (Test / compile / scalacOptions).value
val strict = Seq(
"-Xfatal-warnings",
"-Ywarn-unused"
)
// For sbt 1.3+ where SemanticdbPlugin is available and preferred to manual tweaking,
// scalafixEnable does not manage to enable Semanticdb when scalacOptions are overriden
if (sbtVersion.value.split("\\.")(1).toInt >= 3) old ++ strict else strict
}
Test / compile / scalacOptions ++= Seq(
"-Xfatal-warnings",
"-Ywarn-unused"
)
)
}

0 comments on commit 5fd9592

Please sign in to comment.