Skip to content

Would be nice to be able to ignore lines from coverage #580

@eseidelGoogle

Description

@eseidelGoogle

I'm not sure how one best would implement this (or if it's even possible), but there are certain lines of code in dart which are intentionally unreachable, an example of such is a private constructor.

class Colors {
   Colors._();
}

Which is a pattern used to make a class non-constructable. It's silly that coverage tells me that this line is uncovered:
https://coveralls.io/builds/9847810/source?filename=lib%2Fsrc%2Fmaterial%2Fcolors.dart

But I'm aware of no way with package:coverage to avoid that?

I could imagine a comment syntax, or maybe just teaching package:coverage about this specific idiom? Not sure.

This is not a high priority, but would be nice to have for projects trying for high line or file coverage numbers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions