-
Notifications
You must be signed in to change notification settings - Fork 1.2k
dotnet-format: Support hidden severity for analyzers and code fixes #43929
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
Conversation
Thanks for your PR, @KirillOsenkov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for helping fix this!
Thanks @KirillOsenkov! |
Thinking about this a little more. I wonder if we want to throw an error when severity is set to hidden but no diagnostics are set. @sharwell do you have any thoughts on this? |
So is it good to merge? |
This sounds great, when can it get merged? cc @baronfel |
cc @dotnet/roslyn-ide for feedback |
Without this, you can't fix diagnostics such as --diagnostics VSTHRD111 --severity hidden
f629405
to
e97d1e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the "hidden" severity level in dotnet-format, enabling users to fix diagnostics with hidden severity using the --severity hidden option. This addresses a gap where diagnostics like VSTHRD111 with hidden severity couldn't be processed.
- Added "hidden" as a supported severity level constant
- Updated command line argument validation to accept "hidden" as a valid severity option
- Extended severity parsing logic to map "hidden" to DiagnosticSeverity.Hidden
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/BuiltInTools/dotnet-format/FixSeverity.cs | Adds Hidden constant for the new severity level |
src/BuiltInTools/dotnet-format/Commands/FormatCommandCommon.cs | Updates severity validation and parsing to support hidden severity |
|
||
private static string[] VerbosityLevels => new[] { "q", "quiet", "m", "minimal", "n", "normal", "d", "detailed", "diag", "diagnostic" }; | ||
private static string[] SeverityLevels => new[] { "info", "warn", "error" }; | ||
private static string[] SeverityLevels => new[] { "info", "warn", "error", "hidden" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Large changes should include test changes. This feature addition lacks corresponding test coverage to verify that the 'hidden' severity level is properly accepted and processed by the command line parser and severity mapping logic.
Copilot generated this review using guidance from repository custom instructions.
Chet is my hero |
@KirillOsenkov @baronfel Is this wanted for .NET 10? As current main is .NET 11, this needs a backport if it's needed for .NET 10. |
/backport to release/10.0.1xx |
Started backporting to release/10.0.1xx: https://github.com/dotnet/sdk/actions/runs/17514928925 |
Without this, you can't fix diagnostics such as --diagnostics VSTHRD111 --severity hidden