Closed kyri-petrou closed 3 months ago
Hey @kyri-petrou, this is actually a limitation in the implementation of how coverage works with Scala 3. You can read more about it here. So it'd need to be added upstream in order for this to work.
@ckipp01 aghh I see. Thanks!
I created an MR to address the issue. It would benefit from the upstream changes, but it is not required. Coverage data can be filtered after it was collected.
What is an "MR"?
hey @ivanobulo I just tried release 3.4.2-RC1
and I am still unable to exclude packages or files using any of these options:
coverageExcludedPackages := ...
coverageExcludedFile := ...
Wondering if I could be missing something else?
EDIT: I was able to exclude files and packages passing the filter flags to the compiler options.
thank you so much for the fix 🙂
Could someone kindly explain me how can i exclude an entire package and all its subpackages from the scoverage report on Scala 3.4? How can i exclude files and packages by passing the filter flags to the compiler options?
Could someone kindly explain me how can i exclude an entire package and all its subpackages from the scoverage report on Scala 3.4? How can i exclude files and packages by passing the filter flags to the compiler options?
https://docs.scala-lang.org/overviews/compiler-options/index.html
and i just added this flag:
"-coverage-exclude-files:packages_to_be_excluded"
@ckipp01 is upstream now fixed? Can we proceed implementing the fix that passes the proper flag to the compiler?
Scala 3 supports file and class/package exclusions since 3.4.2 scoverage-maven-plugin was updated recently to support Scala 3 compiler flags
https://github.com/scoverage/scoverage-maven-plugin/pull/237
@ckipp01 is upstream now fixed? Can we proceed implementing the fix that passes the proper flag to the compiler?
Yes, I believe this is fixed, but I also haven't been following. Please do submit a PR for it.
Scala 3 supports file and class/package exclusions since 3.4.2 scoverage-maven-plugin was updated recently to support Scala 3 compiler flags
@jozic can you work on a PR for sbt-scoverage too please :D ? I would do that but I assume you're more proficient with it given that you did it for maven :)
@TonioGela @ckipp01 #541
Hi there. There seems that some coverage settings (primarily
coverageExcludedPackages
andcoverageExcludedFiles
, but I believe some other ones might be affected) are not working with Scala 3.The easiest way to reproduce is by cloning the sbt-scoverage-samples repo, adding the following line to
build.sbt
:and then running
This yields the following:
Scala 2:
Scala 3: