dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.07k stars 4.04k forks source link

Respect severity from 'option_name = option_value:severity' editorconfig entries in IDE features #71483

Open mavasani opened 10 months ago

mavasani commented 10 months ago

As a follow-up to #52991, we should ensure that the following IDE features use/display the correct effective severity for code style analyzers:

JoeRobich commented 10 months ago

Could you also take a look at dotnet-format? When running analyzers, dotnet-format filters them by trying to determine if they could produce a diagnostic of sufficient severity to require fixing. In particular, in AnalyzerOptionsExtensions.cs and Extensions.cs.

sharwell commented 10 months ago

Rules under the Analyzers node in Solution explorer

For this one, it would be acceptable to either not show a severity, or to have a severity glyph which specifically means the severity is set through a custom severity mechanism. Otherwise, there are several rules where the severity will be ambiguous due to the analyzer reporting the same diagnostic under multiple severities (sometimes even within the same document).