Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure we support patch versions larger than 9 #556

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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