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

Exclude before include #37

Closed
dscole opened this issue Jan 3, 2020 · 1 comment · Fixed by #38
Closed

Exclude before include #37

dscole opened this issue Jan 3, 2020 · 1 comment · Fixed by #38

Comments

@dscole
Copy link

dscole commented Jan 3, 2020

In my project I want to restrict the coverage data to only source files inside the project, so I use --include ${CMAKE_SOURCE_DIR}. But, I also want to exclude the test files themselves from the coverage, so I would like to use --exclude test/. Unfortunately, this doesn't work, because in this code:

# Check exclude filter

It seems like if there are any includes, the excludes are basically ignored. If I just move the handling of the excludes to before the includes, everything works as expected for me.
Is there any reason why includes would be first?

@RPGillespie6
Copy link
Owner

It seems like if there are any includes, the excludes are basically ignored.

Indeed, I originally thought of --include and --exclude as being mutually exclusive options.

However, I suppose there's no reason we couldn't remove the mutual exclusion and then specify in the readme that if both are provided, --exclude takes precedence.

RPGillespie6 added a commit that referenced this issue Jan 7, 2020
Description:
- Remove mutual exclusion for file filtering flags
- Fix potential IndexError that could occur if both including and excluding branches
RPGillespie6 added a commit that referenced this issue Jan 7, 2020
Description:
- Remove mutual exclusion for file filtering flags
- Fix potential IndexError that could occur if both including and excluding branches
RPGillespie6 added a commit that referenced this issue Jan 7, 2020
Description:
- Remove mutual exclusion for file filtering flags
- Fix potential IndexError that could occur if both including and excluding branches
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

Successfully merging a pull request may close this issue.

2 participants