From 1da13e65017c1b20117124b205b49730d6d2a0e8 Mon Sep 17 00:00:00 2001 From: Kevin Pilch Date: Wed, 8 Jul 2020 15:26:22 -0700 Subject: [PATCH] Enable FxCop Analyzers for the repo (#23709) All rules are currently disabled, except for one that I enabled for src/Http via a new ".editorconfig" file I added there. Other changes: * Allow editorconfigs in MVC and Razor to flow to the root * Consolidate a few editorconfig settings * Tweak Ruleset config in Azure/AzureAD where it clashed. Addresses the beginning of #9620, but it's a fair chunk of work to enable most rules through the whole repo. That can be done directory by directory and rule by rule by dropping .editorconfig files though. --- .editorconfig | 4 + eng/AllRulesDisabled.ruleset | 216 ++++++++++++++++++++++++++++++ eng/Dependencies.props | 1 + eng/Versions.props | 1 + eng/targets/CSharp.Common.props | 8 ++ src/Azure/AzureAD/AzureAD.ruleset | 3 + src/Http/.editorconfig | 27 ++++ src/Mvc/.editorconfig | 26 ---- src/Razor/.editorconfig | 26 ---- 9 files changed, 260 insertions(+), 52 deletions(-) create mode 100644 eng/AllRulesDisabled.ruleset create mode 100644 src/Http/.editorconfig diff --git a/.editorconfig b/.editorconfig index b1debc81f7..b210dcdbf6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,6 +26,10 @@ dotnet_sort_system_directives_first = true [*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}] indent_size = 2 +# Xml config files +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] +indent_size = 2 + [*.json] indent_size = 2 diff --git a/eng/AllRulesDisabled.ruleset b/eng/AllRulesDisabled.ruleset new file mode 100644 index 0000000000..02d15827b9 --- /dev/null +++ b/eng/AllRulesDisabled.ruleset @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/Dependencies.props b/eng/Dependencies.props index 51caea76d3..d302d52766 100644 --- a/eng/Dependencies.props +++ b/eng/Dependencies.props @@ -111,6 +111,7 @@ and are generated based on the last package release. + diff --git a/eng/Versions.props b/eng/Versions.props index d30ee16788..f2e68c12c2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -188,6 +188,7 @@ 3.7.0-4.20351.7 3.7.0-4.20351.7 3.7.0-4.20351.7 + 3.0.0 1.0.0-20200708.1 3.19.8 5.5.0 diff --git a/eng/targets/CSharp.Common.props b/eng/targets/CSharp.Common.props index a8922df73b..c355896e58 100644 --- a/eng/targets/CSharp.Common.props +++ b/eng/targets/CSharp.Common.props @@ -33,6 +33,14 @@ + + + + + + $(RepoRoot)eng\AllRulesDisabled.ruleset + + diff --git a/src/Azure/AzureAD/AzureAD.ruleset b/src/Azure/AzureAD/AzureAD.ruleset index 57375fd55d..6b6c71d044 100644 --- a/src/Azure/AzureAD/AzureAD.ruleset +++ b/src/Azure/AzureAD/AzureAD.ruleset @@ -1,5 +1,8 @@  + + +