Skip to content

Commit

Permalink
Merge pull request #556 from rolandtritsch/main
Browse files Browse the repository at this point in the history
Make sure we support patch versions larger than 9
  • Loading branch information
rolandtritsch authored Sep 2, 2024
2 parents 8b0f3cc + 7647440 commit b15c706
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/main/scala/scoverage/ScoverageSbtPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,13 @@ object ScoverageSbtPlugin extends AutoPlugin {
}

private def isScala3SupportingFilePackageExclusion(scalaVersion: String) = {
def patch = scalaVersion.split('.').drop(2).headOption
def patch = scalaVersion.split('.').map(_.toInt).drop(2).headOption
CrossVersion
.partialVersion(scalaVersion)
.exists {
case (3, minor)
if minor > 4 || (minor == 4 && patch.exists(_ >= "2")) =>
true
case _ => false
case (3, minor) if minor > 4 => true
case (3, minor) if (minor == 4 && patch.exists(_ >= 2)) => true
case _ => false
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version := "0.1"

scalaVersion := "3.4.2"
scalaVersion := "3.5.0"

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

Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/scoverage/scala3-coverage-excluded-files/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
> test
> coverageReport
# There should be no directory for the excluded files
$ exists target/scala-3.4.2/scoverage-report/GoodCoverage.scala.html
-$ exists target/scala-3.4.2/scoverage-report/two
-$ exists target/scala-3.4.2/scoverage-report/three
$ exists target/scala-3.5.0/scoverage-report/GoodCoverage.scala.html
-$ exists target/scala-3.5.0/scoverage-report/two
-$ exists target/scala-3.5.0/scoverage-report/three

0 comments on commit b15c706

Please sign in to comment.