fix: exclude specific folders from coverage
Description Hi team, we are not able exclude folders from coverage, I don't know if it's a bug, or For instance we have generated folder that include our localization
`very_good test --coverage --exclude-coverage "lib/l10n/**"``
Steps To Reproduce
- On your project folder create dummy folder with some dart files
- Open a terminal
- "cd" to your flutter project folder
- Launch the coverage
very_good test --coverage --exclude-coverage "lib/l10n/**" - See the results of the coverage (using vscode flutter coverage extension)
Expected Behavior The folder excluded must be ignored for coverage
Screenshots
Additional Context Tried also to ignore files directly it's not working too
Hi @stact 👋 thanks for opening this issue. From a quick glance at this we were able to reproduce this so were going to look into the --exclude-coverage flag and it's implementation.
We are always willing to let contributors help with fixes as well. Would you be willing to help with this?
Hi @tomarra thank you for reaching out Unfortunately my knowledge is limited regarding coverage. I was looking in the past some alternative, maybe this PR can help to adapt the vg test https://github.com/dart-lang/coverage/pull/496
Ok it seems something is wrong with very_good test --coverage firstly generated
This solution solved my issue https://github.com/VeryGoodOpenSource/very_good_cli/issues/496#issuecomment-1303258449
lcov --remove coverage/lcov.info '**/generated/**' -o coverage/lcov.info
No problem also on ci.
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
flutter_channel: stable
coverage_excludes: "**/generated/**"
Thank you for your followup @tomarra maybe it can be removed from the backlog