Skip to content
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

Exclude embedded attribute from code coverage #59

Merged
merged 2 commits into from
Jun 4, 2023
Merged

Exclude embedded attribute from code coverage #59

merged 2 commits into from
Jun 4, 2023

Conversation

erri120
Copy link
Contributor

@erri120 erri120 commented May 23, 2023

The embedded EnumExtensionsAttribute should be excluded from code coverage. This can be done using the ExcludeFromCodeCoverage attribute. The attribute is available in the following .NET products and shouldn't require any version guarding:

  • .NET Standard: >= 2.0
  • .NET Framework: >= 4.0
  • .NET: >= Core 2.0

The embedded EnumExtensionsAttribute should be excluded from code
coverage. This can be done using the [ExcludeFromCodeCoverage](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute) attribute.
The attribute is available in the following .NET products:

- .NET Standard: >= 2.0
- .NET Framework: >= 4.0
- .NET: >= Core 2.0
@andrewlock
Copy link
Owner

Thanks for adding this! I think you'll need to update the snapshots to reflect the change to the output so that the tests pass. Is that something you're happy to do? If not I'll take a look soon. Thanks! 🙂

@erri120
Copy link
Contributor Author

erri120 commented May 25, 2023

Thanks for adding this! I think you'll need to update the snapshots to reflect the change to the output so that the tests pass. Is that something you're happy to do? If not I'll take a look soon. Thanks! slightly_smiling_face

The .NET 6 and 7 tests ran without issues. I didn't test other .NET versions because I only have the SDKs for .NET 6 and 7 installed. I checked the snapshots, and it doesn't look like they include the embedded attribute.

@andrewlock andrewlock merged commit 2f222ec into andrewlock:main Jun 4, 2023
@andrewlock
Copy link
Owner

Thanks @erri120, looks good!

@erri120 erri120 deleted the exclude-embedded-attribute-from-code-coverage branch June 5, 2023 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants