Skip to content

Add Scala 3.3.4 around check to support excluded packages and filenames #561

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

Merged
merged 6 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ coverageExcludedFiles := ".*\\/two\\/GoodCoverage;.*\\/three\\/.*"
**NOTE**: The `.scala` file extension needs to be omitted from the
filename, if one is given.

**NOTE**: These two options only work for Scala2 and Scala 3.4.2+.
**NOTE**: These two options only work for Scala2, Scala 3.3.4+ and Scala 3.4.2+.

You can also mark sections of code with comments like:

Expand Down
1 change: 1 addition & 0 deletions src/main/scala/scoverage/ScoverageSbtPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ object ScoverageSbtPlugin extends AutoPlugin {
.exists {
case (3, minor) if minor > 4 => true
case (3, minor) if (minor == 4 && patch.exists(_ >= 2)) => true
case (3, minor) if (minor == 3 && patch.exists(_ >= 4)) => true
case _ => false
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version := "0.1"

scalaVersion := "3.5.0"
scalaVersion := "3.3.4"

libraryDependencies += "org.scalameta" %% "munit" % "1.0.1" % 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.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
$ exists target/scala-3.3.4/scoverage-report/GoodCoverage.scala.html
-$ exists target/scala-3.3.4/scoverage-report/two
-$ exists target/scala-3.3.4/scoverage-report/three
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version := "0.1"

scalaVersion := "3.5.0"
scalaVersion := "3.3.4"

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

Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/scoverage/scala3-coverage-excluded-packages/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 package
$ 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
$ exists target/scala-3.3.4/scoverage-report/GoodCoverage.scala.html
-$ exists target/scala-3.3.4/scoverage-report/two
-$ exists target/scala-3.3.4/scoverage-report/three