[ResxSourceGenerator] Add a NoWarn
attribute
#7489
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[ResxSourceGenerator] Add a
NoWarn
attributeSee #7478
Analyzer
Microsoft.CodeAnalysis.ResxSourceGenerator
Describe the improvement
Currently, a number of problems with Code Analyzers are being reported by developers, related to the generated file.
For example, the requirement for comments on public members (CS1591).
It would be possible to correct each request individually, but a more “global” solution would allow Warnings code to be ignored. Like C# Compiler or csproj propose with its
NoWarn
attribute (see doc), this attribute provides the same solution.Describe suggestions on how to achieve the rule
I added a new
NoWarn
attribute to list all Warning code to ignore (ex. CS1591),added
#pragma warning disable CS1591
at the top of the fileand
#pragma warning restore CS1591
at the end of the fileUnit Tests
New unit tests are added to verify this new feature (C# and VB)