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

add tests for list of coverage exclude patterns and maybe fix documentation (Scala 3) #542

Closed
visma-alexander-maslov opened this issue Jul 8, 2024 · 2 comments · Fixed by #548

Comments

@visma-alexander-maslov
Copy link

The -coverage-exclude-files and -coverage-exclude-packages are MultiStringSettings
https://github.com/scala/scala3/blob/2d0e37353defcec46206e9f0845c738286aabce5/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala#L122-L123

The , is used as a separator, at least according to
https://github.com/scala/scala3/blob/2d0e37353defcec46206e9f0845c738286aabce5/compiler/src/dotty/tools/dotc/config/Settings.scala#L239

README example uses ;

sbt-scoverage/README.md

Lines 77 to 89 in 76a39fb

```scala
coverageExcludedPackages := "<empty>;Reverse.*;.*AuthService.*;models\\.data\\..*"
```
The regular expressions are matched against the fully qualified class name, and
must match the entire string to take effect. Any matched classes will not be
instrumented or included in the coverage report.
You can also exclude files and file paths.
```scala
coverageExcludedFiles := ".*\\/two\\/GoodCoverage;.*\\/three\\/.*"
```

Using ; with the 2.1.0 plugin and 3.4.2 Scala does not exclude specified values. Changing it to , seems to work.
I have only tried it for coverageExcludedFiles, but I guess it works the same for both options.

Tests seems to lack this case.

@ckipp01
Copy link
Member

ckipp01 commented Jul 8, 2024

PRs are welcome.

@jozic
Copy link
Contributor

jozic commented Jul 8, 2024

seems I've missed this, but the fix should be as easy as replace ; with , for Scala 3.
I can send a PR once I have some time or anyone else can contribute as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants