Skip to content

Commit d73dd1d

Browse files
Align .editorconfig with WinForms (#10080)
This effectively copies the .editorconfig from WinForms to align the baseline. As there are many deviations from the rules in the sources, added a temporary .editorconfig in the product src directory. This will need to have rules pulled bit by bit as the projects are fixed. Most of the rules are pretty easy to fix, but would require some pretty massive codefix changes. They are reasonably safe to do, but they will create disruption for existing PRs as they'll need to rebase. Created another .editorconfig specifically for the cycle breaker projects. Fixed the headers in the cycle breakers, but otherwise mostly left them alone. Test projects were updated to pass without needing any overrides. As a general rule, we try to not disable rules for test projects as we want to keep good habits over the entire codebase. The sooner the automated fixes are done, the better. It is better to have this done before Preview 1 and it is better to aggressively push to do them. Don't wait for full test passes in between changes, do a full pass once they are committed. The recommendation: 1. For each rule where there is an automated fix, run the fix and create a PR that says that you ran the codefix 2. Sanity review and merge each as quickly as possible (check off, merge as soon as green) 3. Run a full test pass when finished Clearing the automated fixes should be able to be done in a couple weeks at most. Once the rules are turned on it will significantly improve the contribution process. Less clean up to review, less iteration over rules, etc. Co-authored-by: Harshit <62823486+harshit7962@users.noreply.github.com>
1 parent d209c5c commit d73dd1d

File tree

95 files changed

+2858
-2198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+2858
-2198
lines changed

.editorconfig

Lines changed: 2193 additions & 75 deletions
Large diffs are not rendered by default.

eng/Versions.props

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
<!-- Packages that come from https://github.com/dotnet/arcade -->
5353
<PropertyGroup>
5454
<MicrosoftDotNetApiCompatVersion>9.0.0-beta.24053.1</MicrosoftDotNetApiCompatVersion>
55-
<MicrosoftDotNetCodeAnalysisPackageVersion>10.0.0-beta.24564.1</MicrosoftDotNetCodeAnalysisPackageVersion>
5655
</PropertyGroup>
5756
<!-- Sourcelink -->
5857
<PropertyGroup>
@@ -83,10 +82,6 @@
8382
<NetFramework48RefAssembliesVersion>0.0.0.1</NetFramework48RefAssembliesVersion>
8483
<MicrosoftWindowsCsWin32PackageVersion>0.3.106</MicrosoftWindowsCsWin32PackageVersion>
8584
</PropertyGroup>
86-
<!-- External Analyzers -->
87-
<PropertyGroup>
88-
<MicrosoftCodeAnalysisNetAnalyzersVersion>7.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
89-
</PropertyGroup>
9085
<!-- XUnit-related (not extensions) -->
9186
<PropertyGroup>
9287
<XUnitVersion>2.9.0</XUnitVersion>
@@ -111,6 +106,22 @@
111106
<CodecovVersion>1.9.0</CodecovVersion>
112107
<ReportGeneratorVersion>4.0.9</ReportGeneratorVersion>
113108
</PropertyGroup>
109+
<!-- External Analyzers -->
110+
<PropertyGroup>
111+
<CSharpIsNullAnalyzersVersion>0.1.495</CSharpIsNullAnalyzersVersion>
112+
<DotNetAnalyzersDocumentationAnalyzersVersion>1.0.0-beta.59</DotNetAnalyzersDocumentationAnalyzersVersion>
113+
<MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.24219.2</MicrosoftCodeAnalysisAnalyzersVersion>
114+
<MicrosoftCodeAnalysisCommonPackageVersion>4.10.0-3.final</MicrosoftCodeAnalysisCommonPackageVersion>
115+
<MicrosoftCodeAnalysisCSharpPackageVersion>$(MicrosoftCodeAnalysisCommonPackageVersion)</MicrosoftCodeAnalysisCSharpPackageVersion>
116+
<MicrosoftCodeAnalysisVisualBasicPackageVersion>$(MicrosoftCodeAnalysisCommonPackageVersion)</MicrosoftCodeAnalysisVisualBasicPackageVersion>
117+
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>$(MicrosoftCodeAnalysisCommonPackageVersion)</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
118+
<MicrosoftCodeAnalysisVisualBasicWorkspacesVersion>$(MicrosoftCodeAnalysisCommonPackageVersion)</MicrosoftCodeAnalysisVisualBasicWorkspacesVersion>
119+
<MicrosoftCodeAnalysisPackagesVersion>1.1.3-beta1.24352.1</MicrosoftCodeAnalysisPackagesVersion>
120+
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>$(MicrosoftCodeAnalysisAnalyzersVersion)</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
121+
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
122+
<StyleCopAnalyzersVersion>1.2.0-beta.556</StyleCopAnalyzersVersion>
123+
<NugetPackagingVersion>6.11.0</NugetPackagingVersion>
124+
</PropertyGroup>
114125
<!--Package names-->
115126
<PropertyGroup>
116127
<SystemReflectionMetadataLoadContextPackage>System.Reflection.MetadataLoadContext</SystemReflectionMetadataLoadContextPackage>

eng/WpfArcadeSdk/tools/CodeAnalysis.props

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<Project>
22

33
<PropertyGroup>
4-
<!-- Do not warn about the version of analyzers being used in this project -->
4+
<!-- Only upgrade NuGetAudit warnings to errors for official builds. -->
5+
<WarningsNotAsErrors Condition="'$(OfficialBuild)' != 'true'">$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
6+
7+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
8+
9+
<!--
10+
Don't let Microsoft.CodeAnalysis.NetAnalyzers complain about the version being older than what is in the SDK.
11+
-->
512
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>
613
</PropertyGroup>
714

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
<Project>
2-
<ItemGroup Condition="'$(IsTestProject)'!='true' AND '$(EnableAnalyzers)'=='true'">
3-
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\CodeAnalysis.src.globalconfig" />
4-
<!-- Managed Code Reference analyzers -->
5-
<PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisPackageVersion)" />
2+
<ItemGroup Condition="'$(EnableAnalyzers)'=='true'">
3+
<!-- Managed Code analyzers -->
4+
5+
<!-- https://github.com/DotNetAnalyzers/StyleCopAnalyzers -->
6+
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersVersion)" PrivateAssets="all" />
7+
8+
<!-- https://github.com/dotnet/roslyn-analyzers -->
69
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="$(MicrosoftCodeAnalysisNetAnalyzersVersion)" PrivateAssets="all" />
7-
<PackageReference Include="System.Runtime.Analyzers" Version="1.1.0" />
8-
<PackageReference Include="System.Runtime.InteropServices.Analyzers" Version="1.1.0" />
10+
11+
<!-- https://github.com/DotNetAnalyzers/DocumentationAnalyzers -->
12+
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="$(DotNetAnalyzersDocumentationAnalyzersVersion)" PrivateAssets="all" />
13+
14+
<!-- https://github.com/AArnott/CSharpIsNull -->
15+
<PackageReference Include="CSharpIsNullAnalyzer" Version="$(CSharpIsNullAnalyzersVersion)" PrivateAssets="all" />
916
</ItemGroup>
1017
</Project>

0 commit comments

Comments
 (0)