kotlinx-kover icon indicating copy to clipboard operation
kotlinx-kover copied to clipboard

Kover Not Excluding Function Parameters with Annotation Tag

Open merlinpaypal opened this issue 1 year ago • 2 comments

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

  • Kover Gradle Plugin version: 0.7.6
  • Gradle version: 8.5
  • Kotlin project type: Kotlin/Android Library
  • Coverage Toolset (if customized in build script): Kover

merlinpaypal avatar Mar 20 '24 22:03 merlinpaypal

Any updates on that bug? I use kover version 0.8.2 and have the same problem of being unable to exclude interface with default params image image

BulatInDrive avatar Aug 15 '24 06:08 BulatInDrive

@BulatInDrive, sorry, no updates yet

shanshin avatar Sep 03 '24 19:09 shanshin