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

Is there a way to improve coverage (or ignore) autogenerated code of kotlinx.serialization? #130

Closed
mskonovalov opened this issue Jan 24, 2022 · 4 comments
Milestone

Comments

@mskonovalov
Copy link

mskonovalov commented Jan 24, 2022

So currently if you use serialization all the generated classes got reported as not covered :(

Screen Shot 2022-01-24 at 11 11 54 am

Is there a way to automatically exclude such autogenerated helper classes from coverage?

(Intellij engine is a bit better than JaCoCo but still not perfect)

@mskonovalov mskonovalov changed the title Is there a way to improve coverage (or ignore) autogenerated code os kotlinx.serialization? Is there a way to improve coverage (or ignore) autogenerated code of kotlinx.serialization? Mar 29, 2022
@shanshin
Copy link
Collaborator

shanshin commented Apr 8, 2022

Relates #121

@shanshin shanshin added this to the Release 0.8.0 milestone Apr 8, 2022
@mskonovalov
Copy link
Author

Thanks for looking into this.
I have a suggestion: if possible don't replicate jacoco feature where they require to add @generated annotation to the code you want to ignore.
Instead I'd suggest to allow to configure the list of annotations to ignore in build.gradle.
Thanks

@dar-dawn
Copy link

maybe this?

    filters {
        classes {
            // ignore autogenerated classes generated by 'kotlinx.serialization'
            excludes += listOf("**.*\$\$serializer")
        }
    }

@shanshin
Copy link
Collaborator

shanshin commented Oct 26, 2022

Since version 0.6.1, it has become possible to ignore classes marked with the specified annotations. You can add an exclusion of the annotation kotlin.serialization.Serializable like this example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants