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

Allow exclusions per rule or per limit #1495

Open
joaoluis89 opened this issue Jul 14, 2023 · 1 comment
Open

Allow exclusions per rule or per limit #1495

joaoluis89 opened this issue Jul 14, 2023 · 1 comment

Comments

@joaoluis89
Copy link

THIS IS A BUG TRACKER ONLY. FOR QUESTIONS PLEASE CHECK FAQ OR USE FORUM:

http://www.jacoco.org/jacoco/trunk/doc/faq.html

https://groups.google.com/forum/?fromgroups=#!forum/jacoco

Please understand that
ISSUES WITHOUT FOLLOWING INFORMATION WILL BE CLOSED WITHOUT COMMENTS!
Thank you for filling feature request!

Scenario

  • JaCoCo version: 0.8.8.202204050719
  • Operating system: MacOS Ventura 13.1 (22C65)
  • Tool integration: Maven
  • Description of your use case: (detailed description or executable reproducer, e.g. GitHub repo)

Current Behaviour

Actually we can make exclusions from coverage in general

Wanted Behaviour

We faced some chalenge where we would like to keep the limit of line coverage to a class, but exclude it from branch coverage.
As a matter of fact, we are using map structs that verifies parameter nullity as a guard condition on its generated classes. We would like to enforce the line coverage of it, but prevent the branch coverage of happening

Possible Workarounds

enable excludes on limits or on rules (although on rules would bring up some concerns about how the execution of the coverage is calculated)

@marchof
Copy link
Member

marchof commented Jul 14, 2023

@joaoluis89 For each rule you can specify includes and excludes pattern for the respective entity (e.g. class), see documentation:

https://www.jacoco.org/jacoco/trunk/doc/check-mojo.html#rules

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

No branches or pull requests

2 participants