Kotlin / kotlinx-kover

Apache License 2.0
1.25k stars 46 forks source link

Kover Not Excluding Function Parameters with Annotation Tag #571

Open merlinpaypal opened 1 month ago

merlinpaypal commented 1 month ago

Describe the bug I created a very basic annotation class that mostly works. It does exclude most of the function I want to exclude.

But it doesn't exclude the parameters of the function.

I even tried using it directly on the parameter and it still fails to exclude the parameter.

@Retention(AnnotationRetention.RUNTIME)
@Target(
    AnnotationTarget.CLASS,
    AnnotationTarget.CONSTRUCTOR,
    AnnotationTarget.FIELD,
    AnnotationTarget.FUNCTION,
    AnnotationTarget.LOCAL_VARIABLE,
    AnnotationTarget.PROPERTY,
    AnnotationTarget.TYPE,
    AnnotationTarget.TYPE_PARAMETER,
    AnnotationTarget.VALUE_PARAMETER,
)
annotation class KoverExcludeGenerated

And in my build.gradle, I have

koverReport {
    androidReports('debug') {
        filters {
            excludes {
                annotatedBy(
                    '*KoverExcludeGenerated'
                )
            }
        }
    }
}

Expected behavior I expect parameters to be excluded when a function is excluded.

Reproducer A link to your project, if it is open source. Otherwise, please try to reproduce the problem on a small project. If this is not feasible, give an example of the code on which the problem manifests itself.

Reports

Screenshot 2024-03-20 at 18 30 03

Environment