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

CS1591 is fired on source generated code #54119

Open
chsienki opened this issue Jun 15, 2021 · 7 comments
Open

CS1591 is fired on source generated code #54119

chsienki opened this issue Jun 15, 2021 · 7 comments

Comments

@chsienki
Copy link
Contributor

On a project with the /doc: option enabled, the compiler will issue a warning on code that is coming from a generated file. (see dotnet/runtime#53275)

A user can suppress the issue via a .globalconfig, but has no other recourse to fix the issue. Should we not fire CS1591 for generated code, or is it still a useful indicator to the user that types in their public API are going to have no documentation?

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jun 15, 2021
@sharwell
Copy link
Member

Related to #41171

@chsienki
Copy link
Contributor Author

Note this still occurs if the file correctly marks itself as generated via any of the heuristic methods.

@Youssef1313
Copy link
Member

I don't see why the compiler shouldn't issue the warning?

If the generated type is partial, then this could be a duplicate of #54103, and isn't specific to source generated files. Otherwise, then the compiler is correct about issuing a diagnostic IMO.

@Youssef1313
Copy link
Member

@chsienki Can you check if #56419 resolves this?

@Youssef1313
Copy link
Member

I see there are other aspects than what #56419 solves. (e.g: dotnet/runtime#61379). But I think generator authors should produce a #pragma warning disables or properly generate documentation comments.

Not much convinced the compiler should special case generated code here.

@jcouv
Copy link
Member

jcouv commented Apr 5, 2022

This was also reported regarding [JsonSerializable] (in #60533). We should either have the source generator produce documentation, or do a compiler-level solution. Will chat offline

@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 5, 2022
@jcouv jcouv added this to the 17.3 milestone Apr 5, 2022
@jaredpar jaredpar modified the milestones: 17.3, C# 12.0 Jul 1, 2022
@nabond251
Copy link

FWIW, I'm one of those odd birds that makes the compiler treat warnings like errors. Admittedly bit of a hardline approach, but muh code quality. Such draconian practices are duly rewarded by this breaking build.

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

No branches or pull requests

6 participants