mrverdant13 / coverde

A set of commands for coverage trace files manipulation.
MIT License
30 stars 11 forks source link

Need a feature to exclude some files #76

Closed aguung closed 1 year ago

aguung commented 1 year ago

This library really helps me to generate reports. Maybe you can add a feature/command to exclude some build_runner files with the pattern g.dart/freezed.dart

Thank You

mrverdant13 commented 1 year ago

Hey, @aguung 👋🏼 !

The feature you just described already exists. Have you checked the coverde filter command?

aguung commented 1 year ago

From my code there are build results from parts g.dart and frozen.dart . I have tried running this command but g.dart is still detected in the report results. And this is the result of me running the g.dart filter command image

mrverdant13 commented 1 year ago

I see That is the expected behaviour

The coverde filter command uses coverage/lcov.info as input and coverage/filtered.lcov.info as output. Those are the default, but they can be specified by the --input/-i and --output/-o options. This is described in the coverde filter command docs.

In your case, the updated filtered trace file would be the coverage/filtered.lcov.info file, which is the one that you may use for the report generation with the --input/-i option for the coverde report command.


TL;DR, you need to run

coverde filter -f '\.g\.dart' # which results in the filtered `coverage/filtered.lcov.info` as default output
coverde report -i coverage/filtered.lcov.info

Hope it helps! 🖖🏼

aguung commented 1 year ago

OK, thanks, it works. Sorry for not reading the document carefully.