fontify
fontify copied to clipboard
Exclude generated icon file from coverage
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.
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'
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