Malinskiy / danger-jacoco

danger plugin to check against jacoco xml reports
MIT License
18 stars 24 forks source link

Nested classes #7

Open aafanasev opened 6 years ago

aafanasev commented 6 years ago

Problem

Since danger-jacoco searches classes in jacoco reports by a filename from git diff it cannot find nested classes, f.ex:

Code:

package sample;

class A {
    class B {}
}

Report:

Class:      | Coverage:
sample.A    | 100%
sample.A.B  | 0%

Git modified files:

sample/A.java

Inner class B will be ignored

Kotlin

It's even worst for kotlin classes because kotlin allows to put all classes into single file / High-Level functions / package != location / @JvmName / @JvmMulticlass / etc

Solution

Need to rewrite function classes() (https://github.com/Malinskiy/danger-jacoco/blob/master/lib/jacoco/plugin.rb#L63) to make it able to find all classes inside modified files

For Java it can be just a mask something like class ([\w]+), but for kotlin much more effort is needed

esafirm commented 5 years ago

Any solution for Kotlin?