-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Update the condition used to include the CodeStyle .globalconfig #80540
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
Changes from all commits
502baf3
3a42c06
0506322
b799157
b812f96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,6 +210,10 @@ static string GetTargetContents(string language) | |
| <Target Name="AddGlobalAnalyzerConfigForPackage_MicrosoftCodeAnalysis{language}CodeStyle" BeforeTargets="GenerateMSBuildEditorConfigFileCore;CoreCompile" Condition="'$(SkipGlobalAnalyzerConfigForPackage)' != 'true'"> | ||
| <!-- PropertyGroup to compute global analyzer config file to be used --> | ||
| <PropertyGroup> | ||
| <_IncludeStyleConfiguration>false</_IncludeStyleConfiguration> | ||
| <!-- Check whether 'Style' Level or Mode were configured separate from AnalysisLevel and AnalysisMode. --> | ||
| <_IncludeStyleConfiguration Condition="'$(AnalysisLevelStyle)' != '' Or '$(AnalysisModeStyle)' != ''">true</_IncludeStyleConfiguration> | ||
|
|
||
| <!-- Default 'AnalysisLevelStyle' to the core 'AnalysisLevel' --> | ||
| <AnalysisLevelStyle Condition="'$(AnalysisLevelStyle)' == ''">$(AnalysisLevel)</AnalysisLevelStyle> | ||
|
|
||
|
|
@@ -241,6 +245,10 @@ and an implied numerical option (such as '4') --> | |
| <EffectiveAnalysisLevelStyle Condition="'$(EffectiveAnalysisLevelStyle)' == '' And | ||
| '$(AnalysisLevelStyle)' != ''">$(AnalysisLevelStyle)</EffectiveAnalysisLevelStyle> | ||
|
|
||
| <!-- Check whether the analysis level is high enough that we should include the analyzer configuration. | ||
| From .NET 12, the global config is systematically added if the file exists. Please check https://github.com/dotnet/roslyn/pull/71173 for more info. --> | ||
| <_IncludeStyleConfiguration Condition="'$(EffectiveAnalysisLevelStyle)' != '' and $([MSBuild]::VersionGreaterThanOrEquals('$(EffectiveAnalysisLevelStyle)', '12.0'))">true</_IncludeStyleConfiguration> | ||
|
Comment on lines
+248
to
+250
|
||
|
|
||
| <!-- Set the default analysis mode, if not set by the user --> | ||
| <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysis{language}CodeStyle>$(AnalysisModeStyle)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysis{language}CodeStyle> | ||
| <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysis{language}CodeStyle Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysis{language}CodeStyle)' == ''">$(AnalysisLevelSuffixStyle)</_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysis{language}CodeStyle> | ||
|
|
@@ -255,9 +263,8 @@ and an implied numerical option (such as '4') --> | |
| <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysis{language}CodeStyle Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysis{language}CodeStyle)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysis{language}CodeStyle)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysis{language}CodeStyle)</_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysis{language}CodeStyle> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- From .NET 11, the global config is systematically added if the file exists. Please check https://github.com/dotnet/roslyn/pull/71173 for more info. --> | ||
| <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysis{language}CodeStyle)') and | ||
| ('$(AnalysisLevelStyle)' != '$(AnalysisLevel)' or '$(AnalysisModeStyle)' != '$(AnalysisMode)' or ('$(EffectiveAnalysisLevelStyle)' != '' and $([MSBuild]::VersionGreaterThanOrEquals('$(EffectiveAnalysisLevelStyle)', '11.0'))))"> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As brought up in this comment #63036 (comment), the condition would exclude users who had the following configuration despite configuring
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that we will start warning in these scenarios? Should we document this as a breaking change? |
||
| <!-- Add the analyzer configuration. --> | ||
| <ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysis{language}CodeStyle)') and '$(_IncludeStyleConfiguration)' == 'true'"> | ||
| <EditorConfigFiles Include="$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysis{language}CodeStyle)" /> | ||
| </ItemGroup> | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.