-
Notifications
You must be signed in to change notification settings - Fork 254
Add support for .lcovignore file to exclude files from coverage reports #404
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
Add support for .lcovignore file to exclude files from coverage reports #404
Conversation
How is this different than adding a Three differences I see are that the patterns in the ignore file won't trigger an The feature seems limited in that it requires the ignore file to be in the run directory ( There are no tests for this feature. |
Thanks for the detailed comments. You're right - I hadn't considered the alternative of using the As for the limitation of requiring the file to be in the current working directory - that's a fair point. A potential improvement could be to allow passing a custom path to the I see your point about the current limitations (e.g., lack of match counting, unused pattern warnings, and Perl syntax validation). Those are definitely areas that could be improved or clarified depending on how useful the feature is perceived to be. Do you think having a separate ignore file like this could be a useful addition to lcov? If the feature seems too redundant or niche, I'm also happy to drop it - just wanted to explore if this could be useful to others as well. Also, if you have any suggestions on how this could better align with lcov's current design or configuration philosophy, I'd love to hear them. Thanks again! |
You can pass multiple RC options file to the various lcov tools via the
With respect to counting and With respect to your more general question: yes. This seems rather niche. All that said: I think that the most useful way to support this feature would be to add support for more general file inclusions. That could be useful for other purposes as well (e.g., project, team, and personal settings - which we do in a somewhat less convenient way today). |
FWIW: I realized that it was quite simple, so I went ahead to implement a |
…lusion of config files. See discussion in PR linux-test-project#404 for a discussion of the feature and some potential use models. Signed-off-by: Henry Cox <henry.cox@mediatek.com>
…lusion of config files. See discussion in PR linux-test-project#404 for a discussion of the feature and some potential use models. Signed-off-by: Henry Cox <henry.cox@mediatek.com>
#407 is merged. I think that this one is now obsolete and can be closed. |
Yes, of course. Thank you for your work! |
This PR introduces support for a
.lcovignore
file, allowing users to define patterns for files or directories that should be excluded from coverage reports. Lines starting with # are treated as comments and ignored. If a.lcovignore
file is not present in the current directory, lcov behaves as usual.Example
.lcovignore
:Signed-off-by: Federico Gomez gomez00federico@gmail.com