Add support for exclude by attribute
See original GitHub issueAs 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:
- Add additional argument parameter
--exclude-by-attribute
for CLI tool - Add additional MSBUILD property
ExcludeByAttribute
- Existing implementation to exclude code annotated by
ExcludeByCodeCoverage
remains as is - Exclusion list could be arbitrary specified in multiple, delimited by
,
, just like existingExclude
list. - Any code, i.e.: classes, properties, and methods annotated with listed attributes, will be ignored from coverage.
- The behavior of criteria 5 above, will be similar to how existing
ExcludeByCodeCoverage
works.
TQ.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Add support for exclude by attribute · Issue #232 · coverlet- ...
As of now, coverlet could exclude any classes/methods/properties decorated with ExcludeFromCodeCoverage attribute.
Read more >Exclude attribute value
Hi! Is thare any way to exclude products with attribute value? Let say I have attribute status. It has few numeric values to...
Read more >Attribute Rules - Exclude from Application Evaluation
When unchecked, "Exclude from Application Evaluation" property tells the application that its "safe" to execute this rule locally before sending ...
Read more >Code coverage - attribute driven exclusion - SonarCloud
I am really struggling to find any support around attribute driven exclusions - or any support at all really for !java users…
Read more >ObfuscationAttribute.Exclude Property (System.Reflection)
Gets or sets a Boolean value indicating whether the obfuscation tool should exclude the type or member from obfuscation.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe this is working as part of the build tasks now, @nordinrahman and @tonerdo is there anything left needed to merge #233 ?
@nordinrahman if you can, please try to clone my PR (#233) and see if it meets your needs, it passed the basic tests but I’m struggling a bit to see good ways to test it while in development.