Skip to content

Instantly share code, notes, and snippets.

@Daenyth
Created April 30, 2024 15:37
Show Gist options
  • Save Daenyth/a008964c61b1740974767b833064cc5e to your computer and use it in GitHub Desktop.
Save Daenyth/a008964c61b1740974767b833064cc5e to your computer and use it in GitHub Desktop.
Allow scalatest/scalamock to not ruin -Wnonunit-statement
Test / scalacOptions ++= Seq(
// Allow using -Wnonunit-statement to find bugs in tests without exploding from scalatest assertions
"-Wconf:msg=unused value of type org.scalatest.Assertion:s",
"-Wconf:msg=unused value of type org.scalamock:s"
)
@Daenyth
Copy link
Author

Daenyth commented May 2, 2024

Buggy in scala 3.3, but fixed in 3.4.1: scala/scala3#18804
And a possible workaround: typelevel/sbt-tpolecat#134 (comment)

@Daenyth
Copy link
Author

Daenyth commented May 2, 2024

Also intellij can't handle the scalacOptions being different between test and main when using the built-in compiler, if you're running into that remove the Test / part and it'll use the same flags in both main and test. A little less clean but it gets the job done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment