Skip to content

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

Closed
@visma-alexander-maslov

Description

@visma-alexander-maslov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions