Skip to content

Commit d3663ca

Browse files
committed
Update README with instructions on the new multiple-checks support
1 parent e856e03 commit d3663ca

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,51 @@ be overridden by the version of the `scala-library` compile dependency (if the d
5555
* `minimumRate = <double>` (default `0.75`): The minimum amount of coverage in decimal proportion (`1.0` == 100%)
5656
required for the validation to pass (otherwise `checkScoverage` will fail the build).
5757

58-
* `coverageType = <"Statement" | "Branch" | "Line">` (default `"Statement"`): The type of coverage validated by the
58+
* `coverageType = <CoverageType.Statement | CoverageType.Branch | CoverageType.Line>` (default `CoverageType.Statement`): The type of coverage validated by the
5959
`checkScoverage` task. For more information on the different types, please refer to the documentation of the scalac
6060
plugin (https://github.com/scoverage/scalac-scoverage-plugin).
6161

62+
#### Multiple check tasks
63+
64+
It is possible to configure multiple checks; for instance, one check for a statement rate and another for a branch rate:
65+
```
66+
scoverage {
67+
check {
68+
minimumRate = 0.5
69+
coverageType = CoverageType.Statement
70+
}
71+
check {
72+
minimumRate = 0.8
73+
coverageType = CoverageType.Branch
74+
}
75+
}
76+
```
77+
78+
Note that you cannot mix multiple-checks syntax with plain check configuration:
79+
```
80+
// ok
81+
scoverage {
82+
check {
83+
minimumRate = 0.5
84+
coverageType = CoverageType.Statement
85+
}
86+
}
87+
88+
// ok
89+
scoverage {
90+
minimumRate = 0.2
91+
}
92+
93+
// NOT ok
94+
scoverage {
95+
minimumRate = 0.2
96+
check {
97+
minimumRate = 0.5
98+
coverageType = CoverageType.Statement
99+
}
100+
}
101+
```
102+
62103
### Run without normal compilation
63104

64105
By default, running any of the plugin tasks will compile the code both using "normal" compilation (`compileScala`)

0 commit comments

Comments
 (0)