dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.18k stars 5.85k forks source link

Annotate AnalysisLevel property #29521

Open gewarren opened 2 years ago

gewarren commented 2 years ago

The AnalysisLevel property seems to be shared between C# compiler messages and Roslyn code analysis. I'll log an issue to make note of this in the code analysis and C# compiler options docs.

We also might want to update the verbiage around CodeAnalysisRuleSet since rulesets are deprecated in favor of .editorconfig files.

Originally posted by @gewarren in https://github.com/dotnet/docs/issues/29498#issuecomment-1130331975


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Youssef1313 commented 2 years ago

There was a recent change in this area in https://github.com/dotnet/sdk/pull/24826.

Old behavior was that AnalysisLevel overwrites WarningLevel. So WarningLevel wasn't taken into account if AnalysisLevel is set.

New behavior is AnalysisLevel sets WarningLevel only if the user didn't set WarningLevel himself.

cc @baronfel @jmarolf @mavasani

baronfel commented 2 years ago

Yep, we generally want defaults to only be set if the user hasn't set something, and thanks to @Youssef1313 we found a bug where we were unconditionally setting the WarningLevel. It's definitely been one of those issues' that's spiralled a bit past my initial expected size, though!

BillWagner commented 2 years ago

The docs currently describe the old behavior. See here.

When does the new behavior ship? And, is that going to change the Visual Studio option pages?o