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

Add option to generate ExcludeFromCodeCoverage on source generated objects #1255

Open
zachcwillson opened this issue Aug 9, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@zachcwillson
Copy link

Is your feature request related to a problem? Please describe.
Depending on team tooling, adding excludes for each class or namespace that gets added can be cumbersome.

Describe the solution you'd like
A new bool value added to the NativeMethods.txt schema, maybe named excludeFromCodeCoverage, that when set to true (default false), will add [ExcludeFromCodeCoverage(Justification = "Source Generated Object")] to all generated classes.

Describe alternatives you've considered

  • Add partial class/struct entries in our project for each type and adding the attribute.
  • Configuration of code coverage settings file

Additional context
N/A

@zachcwillson zachcwillson added the enhancement New feature or request label Aug 9, 2024
@AArnott
Copy link
Member

AArnott commented Aug 30, 2024

I wonder how many people actually want this code included in code coverage.
Maybe we should just always apply the attributes, without adding an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants