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

Use EnableCodeStyleSeverity instead of AnalysisLevel to control new diagnostic severity behavior #73843

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

sharwell
Copy link
Member

@sharwell sharwell commented Jun 4, 2024

  • Use built-in features for marking unnecessary code
  • Verify missing code style severity falls back to old behavior
  • Use EnableCodeStyleSeverity instead of AnalysisLevel to control new diagnostic severity behavior

Follow-up to #72238

@sharwell sharwell requested a review from a team as a code owner June 4, 2024 18:24
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 4, 2024
@sharwell sharwell changed the title Custom severity Expand testing for code style severity settings Jun 4, 2024
@sharwell sharwell changed the title Expand testing for code style severity settings Use EnableCodeStyleSeverity instead of AnalysisLevel to control new diagnostic severity behavior Jun 4, 2024
@cremor
Copy link

cremor commented Jun 5, 2024

@sharwell
Copy link
Member Author

sharwell commented Jun 5, 2024

Yes, those would need to be updated. We'll also need to update the SDK code style build targets to feed the new build property to the compiler.

@@ -20,17 +20,6 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseObjectInitializer;
[Trait(Traits.Feature, Traits.Features.CodeActionsUseObjectInitializer)]
public partial class UseObjectInitializerTests
{
private static async Task TestInRegularAndScriptAsync(string testCode, string fixedCode, OutputKind outputKind = OutputKind.DynamicallyLinkedLibrary)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this change produce so much churn in the object init tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This analyzer was using an old strategy for code fading that was interfering with some new testing we needed for the feature change. I converted the analyzer to the new style as a separate commit at the beginning of this PR.

@RikkiGibson RikkiGibson self-assigned this Aug 12, 2024
@sharwell
Copy link
Member Author

Rebased after reviews completed to apply the fixup commit.

@sharwell sharwell merged commit ee863ed into dotnet:main Aug 16, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants