Skip to content

Conversation

KirillOsenkov
Copy link
Member

Without this, you can't fix diagnostics such as --diagnostics VSTHRD111 --severity hidden

@KirillOsenkov KirillOsenkov requested a review from a team as a code owner October 6, 2024 03:26
@ghost ghost added Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch untriaged Request triage from a team member labels Oct 6, 2024
Copy link
Contributor

Thanks for your PR, @KirillOsenkov.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@KirillOsenkov KirillOsenkov added Area-Format and removed Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch labels Oct 6, 2024
Copy link

@baywet baywet left a 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!

@JoeRobich
Copy link
Member

Thanks @KirillOsenkov!

@JoeRobich
Copy link
Member

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?

@KirillOsenkov
Copy link
Member Author

So is it good to merge?

@Frulfump
Copy link

Frulfump commented Jun 22, 2025

This sounds great, when can it get merged? cc @baronfel
A short window left until 10.0.100 is locked but if it can't be included in that maybe a patch or 10.0.2xx?

@baronfel
Copy link
Member

baronfel commented Sep 6, 2025

cc @dotnet/roslyn-ide for feedback

Without this, you can't fix diagnostics such as --diagnostics VSTHRD111 --severity hidden
@baronfel baronfel force-pushed the dev/kirillo/format-hidden branch from f629405 to e97d1e6 Compare September 6, 2025 01:31
@Copilot Copilot AI review requested due to automatic review settings September 6, 2025 01:31
@baronfel baronfel enabled auto-merge (squash) September 6, 2025 01:31
Copy link
Contributor

@Copilot Copilot AI left a 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" };
Copy link
Preview

Copilot AI Sep 6, 2025

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.

@baronfel baronfel merged commit 2946c17 into dotnet:main Sep 6, 2025
27 checks passed
@KirillOsenkov KirillOsenkov deleted the dev/kirillo/format-hidden branch September 6, 2025 02:57
@KirillOsenkov
Copy link
Member Author

Chet is my hero

@Youssef1313
Copy link
Member

@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.

@baronfel
Copy link
Member

baronfel commented Sep 6, 2025

/backport to release/10.0.1xx

Copy link
Contributor

github-actions bot commented Sep 6, 2025

Started backporting to release/10.0.1xx: https://github.com/dotnet/sdk/actions/runs/17514928925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Format untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants