Skip to content

Commit

Permalink
Merge pull request #80 from typelevel/replicate-issue-78
Browse files Browse the repository at this point in the history
Try to replicate issue #78
  • Loading branch information
DavidGregory084 authored Jun 6, 2022
2 parents b9f33c0 + 669b65a commit 9b5a439
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/sbt-test/sbt-tpolecat/modePerConfiguration/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import _root_.io.github.davidgregory084.CiMode
import _root_.io.github.davidgregory084.DevMode
import munit.Assertions._
import scala.util.Try

val Scala211 = "2.11.12"
val Scala212 = "2.12.15"
val Scala213 = "2.13.8"
val Scala30 = "3.0.2"
val Scala31 = "3.1.1"

crossScalaVersions := Seq(
Scala211,
Scala212,
Scala213,
Scala30,
Scala31
)

Compile / tpolecatOptionsMode := CiMode
Test / tpolecatOptionsMode := DevMode

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

assert(hasFatalWarnings)
}

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

assert(!hasFatalWarnings)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.6.2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % System.getProperty("plugin.version"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
object Main {
def main(args: Array[String]): Unit =
println("Hello world")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Unused import
import scala.collection.immutable.ListSet

object HasWarnings {}
6 changes: 6 additions & 0 deletions src/sbt-test/sbt-tpolecat/modePerConfiguration/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Check that the mode is applied in Compile
> +checkCompileOptions
> +compile
# Check that the mode is applied in Test
> +checkTestOptions
> +Test/compile

0 comments on commit 9b5a439

Please sign in to comment.