Skip to content

Commit 2afd99c

Browse files
authored
Added Kover verification rule (#204)
1 parent 387146a commit 2afd99c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
44
*/
55

6+
import kotlinx.kover.gradle.plugin.dsl.MetricType
67
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
78
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
89

910
plugins {
1011
id("kotlinx-io-publish") apply false
1112

13+
alias(libs.plugins.kover)
1214
alias(libs.plugins.bcv)
1315
alias(libs.plugins.dokka)
1416
}
@@ -37,3 +39,19 @@ subprojects {
3739
apiValidation {
3840
ignoredProjects.add("kotlinx-io-benchmarks")
3941
}
42+
43+
dependencies {
44+
kover(project(":kotlinx-io-core"))
45+
kover(project(":kotlinx-io-bytestring"))
46+
}
47+
48+
koverReport {
49+
verify {
50+
rule {
51+
minBound(95, MetricType.LINE)
52+
53+
// we allow lower branch coverage, because not all checks in the internal code lead to errors
54+
minBound(80, MetricType.BRANCH)
55+
}
56+
}
57+
}

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
kotlin = "1.9.0"
33
java = "8"
44
dokka = "1.8.20"
5-
kover = "0.7.1"
5+
kover = "0.7.3"
66
bcv = "0.13.2"
77
benchmark = "0.4.9"
88
jmh = "1.36"

0 commit comments

Comments
 (0)