-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poor documentation around attribute-based exclusion #1591
Comments
Yes you are right. We have written this down a bit more detailed here: docs
No matter what driver you are using you need to run the test at some point which is usually done by
With this setting you can specify additional attributes for exclusion. So it just adds to it.
You can specify the additional exclusion attributes with or without the postfix. This can be seen here: https://github.com/coverlet-coverage/coverlet/blob/master/src/coverlet.core/Instrumentation/Instrumenter.cs#L96 But only the type names without the namespaces, e.g. |
|
I am trying to find somewhere in the documentation which states the default list of attributes that cause things to be excluded from coverage.
I'm guessing the answer is simply "System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute", but I can't see that documented anywhere.
I'm using the "dotnet test" approach if that matters. I think the documentation for that is https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md
The only mention on there of anything close to this is the example which shows
Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute
but there is no explanation for what that does. For example, does that setting replace the default attributes that are used to exclude things, or does it just add to it?
I have read elsewhere that these are just the "name" of the attribute, without needing to be fully-qualified... it would be nice if that was documented here as well.
And I saw a comment somewhere saying don't forget the "Attribute" on the end. If that's true, if would be useful to have that here too, and if that's the case, then is the "Obsolete" example faulty?
The text was updated successfully, but these errors were encountered: