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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some more Roslyn generated file suffixes #1352

Merged

Conversation

georgevanburgh
Copy link
Contributor

As discussed in #1084, coverlet fails to generate metrics for assemblies that contain source generators. This was improved in #1091 by skipping files that end in .g.cs. However, some source generators produce files which do not match this pattern - for example protobuf-net.BuildTools. Obviously coverlet is never going to be able to match against every possible generated file naming convention - which is where the suggestion in #1164 comes from. I understand if you'd rather use the ideas from that issue in preference to this change, however, I thought it might make sense to add the list of conventions used internally by Microsoft.CodeAnalysis to the logic introduced in #1091 for detecting auto-generated files (selfishly, this would also fix the issues I'm having with projects that reference protobuf-net.BuildTools 馃槆).

Copy link
Collaborator

@petli petli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think it should be pretty safe to add these additional conditions, it is quite unlikely that it will result in a module being instrumented that wasn't before.

@MarcoRossignoli MarcoRossignoli changed the title Add some more generated file suffixes Add some more Roslyn generated file suffixes Jun 24, 2022
@MarcoRossignoli MarcoRossignoli merged commit e50e24d into coverlet-coverage:master Jun 24, 2022
@MarcoRossignoli
Copy link
Collaborator

thanks!

@georgevanburgh georgevanburgh deleted the generated-files branch June 24, 2022 08:39
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.

None yet

3 participants