Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ You can customise the environment variable that is used to enable this mode by m

To enable the continuous integration mode, use the `tpolecatCiMode` command or define the environment variable `SBT_TPOLECAT_CI`.

In this mode all development mode options are enabled, and the fatal warnings option (`-Xfatal-warnings` ) is added.
In this mode all development mode options are enabled, and the fatal warnings option (`-Xfatal-warnings` or `-Werror`, depending on the Scala version ) is added.

You can customise the options that are enabled in this mode by modifying the `tpolecatCiModeOptions` key. Default: `tpolecatDevModeOptions.value + ScalacOptions.fatalWarnings`.
You can customise the options that are enabled in this mode by modifying the `tpolecatCiModeOptions` key. Default: `tpolecatDevModeOptions.value + ScalacOptions.fatalWarningOptions`.

For example, to disable unused linting you could customise the CI options as follows:

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lazy val `sbt-tpolecat-plugin` = project
Test / headerCreate := { (Test / headerCreate).triggeredBy(Test / compile).value },
scalacOptions += "-Xlint:unused",
libraryDependencies ++= Seq(
"org.typelevel" %% "scalac-options" % "0.1.8",
"org.typelevel" %% "scalac-options" % "0.1.9",
"org.scalatest" %% "scalatest" % "3.2.19" % Test
),
mimaPreviousArtifacts := Set(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ object TpolecatPlugin extends AutoPlugin {
tpolecatVerboseModeOptions := tpolecatDevModeOptions.value ++ ScalacOptions.verboseOptions
),
Def.derive(
tpolecatCiModeOptions := tpolecatDevModeOptions.value + ScalacOptions.fatalWarnings
tpolecatCiModeOptions := tpolecatDevModeOptions.value ++ ScalacOptions.fatalWarningOptions
),
Def.derive(
tpolecatReleaseModeOptions := tpolecatCiModeOptions.value + ScalacOptions.optimizerMethodLocal
Expand Down
12 changes: 6 additions & 6 deletions plugin/src/sbt-test/sbt-tpolecat/modePerConfiguration/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Compile / tpolecatOptionsMode := CiMode
Test / tpolecatOptionsMode := DevMode

TaskKey[Unit]("checkCompileOptions") := {
val hasFatalWarnings =
scalacOptions.value.contains("-Xfatal-warnings")
val options = scalacOptions.value
val hasFatalWarningsOrWarnError = options.contains("-Xfatal-warnings") || options.contains("-Werror")

assert(hasFatalWarnings)
assert(hasFatalWarningsOrWarnError)
}

TaskKey[Unit]("checkTestOptions") := {
val hasFatalWarnings =
(Test / scalacOptions).value.contains("-Xfatal-warnings")
val options = (Test / scalacOptions).value
val hasFatalWarningsOrWarnError = options.contains("-Xfatal-warnings") || options.contains("-Werror")

assert(!hasFatalWarnings)
assert(!hasFatalWarningsOrWarnError)
}
22 changes: 12 additions & 10 deletions plugin/src/sbt-test/sbt-tpolecat/scalacOptions/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,11 @@ TaskKey[Unit]("checkCiMode") := {
val expectedOptions = scalaV match {
case Scala211 => Scala211Options ++ Seq("-Xfatal-warnings")
case Scala212 => Scala212Options ++ Seq("-Xfatal-warnings")
case Scala213 => Scala213Options ++ Seq("-Xfatal-warnings")
case Scala30 => Scala30Options ++ Seq("-Xfatal-warnings")
case Scala31 => Scala31Options ++ Seq("-Xfatal-warnings")
case Scala33 => Scala33Options ++ Seq("-Xfatal-warnings")
case Scala331 => Scala331Options ++ Seq("-Xfatal-warnings")
case Scala213 => Scala213Options ++ Seq("-Werror")
case Scala30 => Scala30Options ++ Seq("-Werror")
case Scala31 => Scala31Options ++ Seq("-Werror")
case Scala33 => Scala33Options ++ Seq("-Werror")
case Scala331 => Scala331Options ++ Seq("-Werror")
}

val actualOptions = scalacOptions.value
Expand All @@ -294,6 +294,8 @@ TaskKey[Unit]("checkReleaseMode") := {

val fatalWarnings = Seq("-Xfatal-warnings")

val warnError = Seq("-Werror")

val optimizerMethodLocal = Seq("-opt:l:method")

val optimizerInline = Seq(
Expand All @@ -316,14 +318,14 @@ TaskKey[Unit]("checkReleaseMode") := {
"8"
)
case Scala213 =>
Scala213Options ++ fatalWarnings ++ optimizerMethodLocal ++ releaseOptions ++ optimizerInline ++ Seq(
Scala213Options ++ warnError ++ optimizerMethodLocal ++ releaseOptions ++ optimizerInline ++ Seq(
"-Ybackend-parallelism",
"8"
)
case Scala30 => Scala30Options ++ fatalWarnings ++ releaseOptions
case Scala31 => Scala31Options ++ fatalWarnings ++ releaseOptions
case Scala33 => Scala33Options ++ fatalWarnings ++ releaseOptions
case Scala331 => Scala331Options ++ fatalWarnings ++ releaseOptions
case Scala30 => Scala30Options ++ warnError ++ releaseOptions
case Scala31 => Scala31Options ++ warnError ++ releaseOptions
case Scala33 => Scala33Options ++ warnError ++ releaseOptions
case Scala331 => Scala331Options ++ warnError ++ releaseOptions
}

val actualOptions = scalacOptions.value
Expand Down