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 the GeneratedCodeAttribute to generated code #1038

Closed
rcollette opened this issue Dec 28, 2023 · 3 comments · Fixed by #1069
Closed

Add the GeneratedCodeAttribute to generated code #1038

rcollette opened this issue Dec 28, 2023 · 3 comments · Fixed by #1069
Labels

Comments

@rcollette
Copy link

Is your feature request related to a problem? Please describe.
Coverlet allows for exclusion of code having specific attributes, such as

dotnet test "My.csproj" -p:ExcludeByAttribute=\"GeneratedCodeAttribute,CompilerGeneratedAttribute\"

But currently this attribute doesn't exist on the generated code, like other source generators such as the .NET Regex source generator.

Describe the solution you'd like
Add GeneratedCodeAttribute to generated classes.

Describe alternatives you've considered
I've tried using file exclusions like:

dotnet test "My.csproj" -p:ExcludeByAttribute=\"GeneratedCodeAttribute,CompilerGeneratedAttribute\" -p:ExcludeByFile=\"**/*.g.cs\"

But mapperly generated code still shows up in coverage reports.

image

Along with messages the the related .g.cs file no longer exists.

@latonz latonz added the enhancement New feature or request label Dec 28, 2023
@latonz
Copy link
Contributor

latonz commented Dec 28, 2023

Feel free to open a PR implementing this. Some starting points:

Copy link

github-actions bot commented Feb 5, 2024

🎉 This issue has been resolved in version 3.4.0-next.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This issue has been resolved in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants