Skip to content

Add support for exclude by attribute #232

@nordinrahman

Description

@nordinrahman

As of now, coverlet could exclude any classes/methods/properties decorated with ExcludeFromCodeCoverage attribute. However, it does not applicable for code annotated by other attributes like GeneratedCodeAttribute nor CompilerGeneratedAttribute. In short, it does not allow user to exclude with arbitrary attribute. This is one of most common feature for other coverage tool (e.g. dotcover) that I usually use.

There are already demands to this feature, as listed below:

The feature will have the following criteria:

  1. Add additional argument parameter --exclude-by-attribute for CLI tool
  2. Add additional MSBUILD property ExcludeByAttribute
  3. Existing implementation to exclude code annotated by ExcludeByCodeCoverage remains as is
  4. Exclusion list could be arbitrary specified in multiple, delimited by ,, just like existing Exclude list.
  5. Any code, i.e.: classes, properties, and methods annotated with listed attributes, will be ignored from coverage.
  6. The behavior of criteria 5 above, will be similar to how existing ExcludeByCodeCoverage works.

TQ.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementGeneral enhancement request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions