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 a setting to turn off warning suppressions in source generated pinvoke code. #171

Closed
AraHaan opened this issue Mar 3, 2021 · 1 comment
Labels
wontfix This will not be worked on

Comments

@AraHaan
Copy link
Contributor

AraHaan commented Mar 3, 2021

In my project, I never suppress even with #pragma, instead I do it with my .editorconfig.

Likewise I also use other analyzers which the source generated pinvoke's might warn on and not suppress at all on so then I might then have to change the warning level on them anyways inside of my .editorconfig.

So ye at this rate we might as well have an option to opt-out of suppressing warnings inside of the source generated files to prefer our settings in our .editorconfig.

@AArnott
Copy link
Member

AArnott commented Mar 3, 2021

Analyzers shouldn't usually run on generated code anyway. If you have analyzers that do, that might be a bug in the analyzer that's worth filing against them.
We suppress warnings within the generated files that are actually emitted by the compiler itself, as we never want the compiler to emit warnings to the user for code we generate, particularly when we know it's either not a problem, or one we will take care of. We don't want users to have to suppress the warnings themselves, especially if that suppression might apply project-wide.
You're welcome to suppress anything you want in your project, of course, but adding a feature to remove the source-level suppressions from the generated code would add complexity to the generator with little or no real benefit to the user.

@AArnott AArnott added the wontfix This will not be worked on label Mar 3, 2021
@AArnott AArnott closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants