github-actions-report-lcov icon indicating copy to clipboard operation
github-actions-report-lcov copied to clipboard

Remove files from coverage

Open stefangaller opened this issue 3 years ago • 2 comments

A feature that I would find nice would be to remove some files from the coverage report. It could simply use the lcov command like this: lcov --remove coverage/lcov.info 'lib/**/*.g.dart' -o coverage/clean_lcov.info

stefangaller avatar Jan 24 '22 07:01 stefangaller

+1

aismaniotto avatar Feb 15 '22 22:02 aismaniotto

We're achieving this by doing it prior to passing the lcov report to this action by using remove_from_coverage.

Our entire script looks something like:

set -e
set -o pipefail

dart pub global activate coverage
dart pub global activate remove_from_coverage
dart test --coverage=coverage && pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib
dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '.freezed.dart$' -r '.g.dart$'

We then pass the coverage/lcov.info to the action.

btrautmann avatar Feb 23 '22 14:02 btrautmann