fontify icon indicating copy to clipboard operation
fontify copied to clipboard

Exclude generated icon file from coverage

Open renefloor opened this issue 2 years ago • 2 comments

This generated file is part of a (Flutter) project. However, the private constructor can't be tested. So projects using this can't aim for 100% coverage. With this line you can ignore this complete file from the test coverage. We could also use

// coverage:ignore-line to ignore one line.
// coverage:ignore-start and // coverage:ignore-end to ignore range of lines inclusive.

renefloor avatar Aug 05 '22 16:08 renefloor

Hello, I ran into the same problem and found a better solution I think : Instead of ignoring coverage with the line // coverage:ignore:file, you can use a custom output class file with the option fortify ... --output-class-file=.../icons.g.dart to mark it as generated and then remove those .g files from coverage with remove_from_coverage package : remove_from_coverage -r '\.g\.dart'

Cteq3132 avatar Sep 15 '22 08:09 Cteq3132

I totally agree. Would be nice to update the readme to show that in the example config: https://github.com/westracer/fontify#cli-tool-config-file

renefloor avatar Sep 23 '22 08:09 renefloor