Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress Coverage for only functions instead of the whole class #705

Closed
rallat opened this issue Nov 15, 2024 · 3 comments
Closed

Suppress Coverage for only functions instead of the whole class #705

rallat opened this issue Nov 15, 2024 · 3 comments
Assignees
Labels
Question Support request issue type S: waiting for clarification Status: additional information required to proceed

Comments

@rallat
Copy link

rallat commented Nov 15, 2024

What is your use-case and why do you need this feature?
We have classes that are mostly testable and we would like to suppress coverage only for certain functions.

Describe the solution you'd like
A way for us to suppress coverage at the function level. It could be via annotation at the top of the function.

@rallat rallat added Feature Feature request issue type S: untriaged Status: issue reported but unprocessed labels Nov 15, 2024
@shanshin
Copy link
Collaborator

Hi,
if you specify a special filter

kover {
    reports.filters.excludes.annotatedBy("*.KoverExclude")
}

this will exclude the function marked with an annotation from the report

class Example {
    @KoverExclude
    fun functionToExclude() {
        ...
    }
}

@shanshin shanshin added S: waiting for clarification Status: additional information required to proceed Question Support request issue type and removed S: untriaged Status: issue reported but unprocessed Feature Feature request issue type labels Nov 18, 2024
@shanshin
Copy link
Collaborator

Closed as answered

@rallat
Copy link
Author

rallat commented Nov 27, 2024

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Support request issue type S: waiting for clarification Status: additional information required to proceed
Projects
None yet
Development

No branches or pull requests

2 participants