Skip to content

feat: Exclude generated attributes from code coverage #81

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

skarllot
Copy link
Contributor

What’s changed

Two internal attribute types in RegisterAttributesExtensions.cs are now marked as generated code and excluded from code-coverage analysis.

  • GeneratedCode attribute signals to tools that these types are auto-generated.
  • ExcludeFromCodeCoverage ensures coverage reports (e.g. Coverlet, Visual Studio) skip these classes.

Why

Coverage tools can skew metrics by including boilerplate attribute definitions that aren’t hand-written or relevant to business logic. By marking them as generated and excluding them, we:

  • Keep overall coverage percentages meaningful
  • Avoid noise when tracking real coverage gaps
  • Follow best practices for generated code hygiene

How to verify

  1. Run your coverage suite (e.g. dotnet test /p:CollectCoverage=true).
  2. Observe that neither of the two attribute classes appears in the coverage report.
  3. Confirm no other tests or behavior have regressed.

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.

1 participant