Skip to content

Commit

Permalink
Merge pull request #57 from DavidGregory084/fatal-warnings-universal
Browse files Browse the repository at this point in the history
Make -Xfatal-warnings a universal option again
  • Loading branch information
DavidGregory084 authored Mar 30, 2022
2 parents e7b634b + ed57050 commit f8443a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,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 warning options (`-Xfatal-warnings` / `-Werror`) are added as appropriate for your Scala version.
In this mode all development mode options are enabled, and the fatal warnings option (`-Xfatal-warnings` ) is added.

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ trait ScalacOptions {
/** Fail the compilation if there are any warnings.
*/
val fatalWarnings =
advancedOption("fatal-warnings", version => version < V2_13_0 || version >= V3_0_0)
advancedOption("fatal-warnings")

/** Enable recommended warnings.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ object TpolecatPlugin extends AutoPlugin {
override def projectSettings: Seq[Setting[_]] = Seq(
scalacOptions := scalacOptionsFor(scalaVersion.value, tpolecatScalacOptions.value),
tpolecatDevModeOptions := ScalacOptions.default,
tpolecatCiModeOptions := tpolecatDevModeOptions.value ++ ScalacOptions.fatalWarningOptions,
tpolecatCiModeOptions := tpolecatDevModeOptions.value + ScalacOptions.fatalWarnings,
tpolecatReleaseModeOptions := tpolecatCiModeOptions.value + ScalacOptions.optimizerMethodLocal,
tpolecatScalacOptions := {
(ThisBuild / tpolecatOptionsMode).value match {
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/sbt-tpolecat/scalacOptions/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ TaskKey[Unit]("checkCiMode") := {
val expectedOptions = scalaV match {
case Scala211 => Scala211Options ++ Seq("-Xfatal-warnings", "-Ypartial-unification")
case Scala212 => Scala212Options ++ Seq("-Xfatal-warnings", "-Ypartial-unification")
case Scala213 => Scala213Options ++ Seq("-Werror")
case Scala213 => Scala213Options ++ Seq("-Xfatal-warnings")
case Scala30 => Scala30Options ++ Seq("-Xfatal-warnings")
case Scala31 => Scala31Options ++ Seq("-Xfatal-warnings")
}
Expand Down Expand Up @@ -220,7 +220,7 @@ TaskKey[Unit]("checkReleaseMode") := {
)
case Scala213 =>
Scala213Options ++ Seq(
"-Werror",
"-Xfatal-warnings",
"-opt:l:method",
"-opt:l:inline",
"-opt-inline-from:**"
Expand Down

0 comments on commit f8443a1

Please sign in to comment.