Skip to content

Commit

Permalink
feat: add support for 2.12.16 with newest scoverage
Browse files Browse the repository at this point in the history
This bumps the version of scoverage to the 2.0.0-RC1.

NOTE: That will this it also removes the long deprecated
`coverageMinimum`. You'll need to replace it with
`coverageMinimumStmtTotal`.
  • Loading branch information
ckipp01 committed Jun 8, 2022
1 parent 636111f commit d86faca
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name := "sbt-scoverage"

import sbt.ScriptedPlugin.autoImport.scriptedLaunchOpts

lazy val scoverageVersion = "2.0.0-M5"
lazy val scoverageVersion = "2.0.0-RC1"

inThisBuild(
List(
Expand Down
4 changes: 1 addition & 3 deletions src/main/scala/scoverage/CoverageMinimum.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ object CoverageMinimum {

def all = Def.setting {
import ScoverageKeys._
val stmtTotal =
math.max(coverageMinimum.value, coverageMinimumStmtTotal.value)
All(
total = CoverageMinimum(
statement = stmtTotal,
statement = coverageMinimumStmtTotal.value,
branch = coverageMinimumBranchTotal.value
),
perPackage = CoverageMinimum(
Expand Down
3 changes: 0 additions & 3 deletions src/main/scala/scoverage/ScoverageKeys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ object ScoverageKeys {
lazy val coverageSourceRoot = settingKey[File]("the source root of the project")
// format: on

@deprecated("Use coverageMinimumStmtTotal instead", "v1.8.0")
lazy val coverageMinimum =
settingKey[Double]("see coverageMinimumStmtTotal")
lazy val coverageMinimumStmtTotal =
settingKey[Double]("scoverage minimum coverage: statement total")
lazy val coverageMinimumBranchTotal =
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/scoverage/ScoverageSbtPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ object ScoverageSbtPlugin extends AutoPlugin {
coverageEnabled := false,
coverageExcludedPackages := "",
coverageExcludedFiles := "",
coverageMinimum := 0, // default is no minimum
coverageMinimumStmtTotal := 0,
coverageMinimumBranchTotal := 0,
coverageMinimumStmtPerPackage := 0,
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/bad-coverage/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ scalaVersion := "2.13.6"

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test

coverageMinimum := 80
coverageMinimumStmtTotal := 80

coverageFailOnMinimum := true

Expand Down
1 change: 0 additions & 1 deletion src/sbt-test/scoverage/coverage-off/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ scalaVersion := "2.13.6"

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test

coverageMinimum := 80
coverageMinimumStmtTotal := 100
coverageMinimumBranchTotal := 100
coverageMinimumStmtPerPackage := 100
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/data-dir/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ libraryDependencies += "org.specs2" %% "specs2-core" % "4.12.10" % "test"

coverageDataDir := target.value / "custom-test"

coverageMinimum := 80
coverageMinimumStmtTotal := 80

coverageFailOnMinimum := true

Expand Down
1 change: 0 additions & 1 deletion src/sbt-test/scoverage/good-coverage/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ scalaVersion := "2.13.6"

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test

coverageMinimum := 80
coverageMinimumStmtTotal := 100
coverageMinimumBranchTotal := 100
coverageMinimumStmtPerPackage := 100
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/scala3-bad/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ scalaVersion := "3.2.0-RC1-bin-20220523-6783853-NIGHTLY" // TODO: Should be upda

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test

coverageMinimum := 80
coverageMinimumStmtTotal := 80

coverageFailOnMinimum := true

Expand Down
1 change: 0 additions & 1 deletion src/sbt-test/scoverage/scala3-good/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ scalaVersion := "3.2.0-RC1-bin-20220523-6783853-NIGHTLY" // TODO: Should be upda

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test

coverageMinimum := 80
coverageMinimumStmtTotal := 100
coverageMinimumBranchTotal := 100
coverageMinimumStmtPerPackage := 100
Expand Down

0 comments on commit d86faca

Please sign in to comment.