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

Sourcelink for code generators #1323

Conversation

daveMueller
Copy link
Collaborator

closes #1322

@daveMueller daveMueller force-pushed the 1322_SourceLinkCodeGenerators branch from 1f3d96b to 6e49a68 Compare April 18, 2022 00:50
@daveMueller
Copy link
Collaborator Author

While analyzing #1322 I stumbled across the issue that getting the sourcelink url for a code generator class throws. As a quick fix I just returned the relative path so that it doesn't fail anymore. But I could also think of something like removing those files from the coverage result?

I think there is still a general problem with code generators. Sure we can collect hits et cetera, but we can't really map this to a source file because initially no physical file exists. And I think there are a couple of places in coverlet where this causes problems. E.g. the SourceRootTranslator can't resolve the file path because it doesn't exist.
Maybe it would be the best to exclude those files from the instrumentation? Was there already a discussion about this that I missed?
cc: @MarcoRossignoli @petli @tonerdo

@MarcoRossignoli
Copy link
Collaborator

I think that at the moment we have this one #1164 on the subject

@MarcoRossignoli MarcoRossignoli merged commit 104bf16 into coverlet-coverage:master Apr 18, 2022
@daveMueller daveMueller deleted the 1322_SourceLinkCodeGenerators branch April 19, 2022 21:40
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.

Incorrect coverage - only one module detected
2 participants