tenchi2xh / sbt-lethal-warnings   0.1.2

MIT License GitHub

Selectively escalate warnings to errors: -Xfatal-warnings with a whitelist

Scala versions: 2.12
sbt plugins: 1.0

sbt-lethal-warnings

CircleCI branch Codacy grade

Selectively escalate warnings to errors: -Xfatal-warnings with a whitelist.

Usage

Add the following to the project/plugin.sbt:

addSbtPlugin("net.team2xh" % "sbt-lethal-warnings" % "[Version in badge above]")

In build.sbt, configure which warnings need to be escalated to errors:

import sbt.LethalWarnings._
lethalWarnings := Seq(/* Desired warnings */)

Available warnings

Key Matching warning
NonExhaustivePatternMatch Missing cases in pattern match blocks
UniversalEquality Comparing objects of different types
MatchOnErased Type erasure in pattern matches

To lethalize all warnings supported by the plugin, use the following setting:

lethalWarnings := allWarnings

Testing

Tests are using scripted SBT and scripted-scalatest to run a nested SBT instance compiling the project located at src/sbt-test/sbt-lethal-warnings/test-warnings/. To execute the test suite, run the following from the root of the project:

sbt scripted