Skip to content

add filter: GetterAndSetterFilter - #923

Closed
donhui wants to merge 2 commits into
jacoco:masterfrom
donhui:add_filter
Closed

donhui wants to merge 2 commits into
jacoco:masterfrom
donhui:add_filter

Conversation

@donhui

@donhui donhui commented Aug 21, 2019

Copy link
Copy Markdown

add filter: GetterAndSetterFilter

@marchof

marchof commented Aug 22, 2019

Copy link
Copy Markdown
Member

@donhui Thanks for this contribution! Filtering user code is very controversial. Therefore we decided not to include them in JaCoCo. It will simply cause too many discussions with our users which we can't handle with our limited resources. Therefore we currently only focus on filtering compiler generated synthetic code.

Also as you can see from the broken build, getting filters right is a cumbersome task. Your filter breaks an Kotlin integration test.

Thanks for your understanding!

@donhui

donhui commented Aug 22, 2019

Copy link
Copy Markdown
Author

I wonder why my filter breaks an Kotlin integration test.
Because I never change the Kotlin code.

@marchof

marchof commented Aug 22, 2019 •

Copy link
Copy Markdown
Member

Probably because your filter has side effects on filtering of classfiles generated by the Kotlin compiler?

We have lots of integration tests for different JVM languages. Actually there should also be one for your filter.

But as said before: We will currently not include user code filtering.

@donhui

donhui commented Aug 22, 2019

Copy link
Copy Markdown
Author

Probably because your filter has side effects on filtering of classfiles generated by the Kotlin compiler?

We have lots of integration tests for different JVM languages. Actually there should also be one for your filter.

But as said before: We will currently not include user code filtering.

I see. Thank you!

@asolntsev

Copy link
Copy Markdown

We would like to filter out getters/setters because of Kotlin.
In Kotlin, we have data classes which have generated getters/setters. We don't want to test them neither see those "uncovered" lines in JaCoCo report.

@donhui

@donhui

donhui commented Mar 31, 2020

Copy link
Copy Markdown
Author

@asolntsev
you can reference the code of this PR, then custom your jacoco jar and related plugins.

@asolntsev

Copy link
Copy Markdown

@donhui thank you, I know that in open-source world it's always possible to fork&customize :)

But for most of users, it's too hard way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants