-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Labels
BugBug issue typeBug issue typeS: untriagedStatus: issue reported but unprocessedStatus: issue reported but unprocessed
Description
I have spent a long time being very confused, stepping through debuggers, and creating a reproducer only to find out that I was using the DSL incorrectly. I think it is a design issue, as it is too easy for users to get mixed up.
I was doing this:
kover {
reports {
verify {
rule {
bound {
coverageUnits.set(CoverageUnit.BRANCH)
minBound(75)
}
}
}
}
}And my output kept looking like this:
Rule violated: lines covered percentage is 12.500000, but expected minimum is 75I was very confused why it kept using lines instead of branches. Finally, I discovered I needed to do this:
kover {
reports {
verify {
rule {
bound {
coverageUnits.set(CoverageUnit.BRANCH)
minValue = 75 // <-- Change here
}
}
}
}
}And now it works:
Rule violated: branches covered percentage is 0.000000, but expected minimum is 75I think that the correct solution here is to use the @DslMarker annotation on all DSL objects. I mean, create an annotation called KoverDsl, annotate that annotation with @DslMarker, and put KoverDsl on all kover dsl interfaces.
Metadata
Metadata
Assignees
Labels
BugBug issue typeBug issue typeS: untriagedStatus: issue reported but unprocessedStatus: issue reported but unprocessed