diff --git a/eng/config/globalconfigs/Common.globalconfig b/eng/config/globalconfigs/Common.globalconfig new file mode 100644 index 0000000000000..667d755443434 --- /dev/null +++ b/eng/config/globalconfigs/Common.globalconfig @@ -0,0 +1,99 @@ +is_global = true + +dotnet_diagnostic.CA1067.severity = warning +dotnet_diagnostic.CA1068.severity = warning +dotnet_diagnostic.CA1200.severity = warning +dotnet_diagnostic.CA1821.severity = warning + +dotnet_diagnostic.IDE0055.severity = warning + +dotnet_diagnostic.RS1001.severity = none +dotnet_diagnostic.RS1002.severity = none +dotnet_diagnostic.RS1003.severity = none +dotnet_diagnostic.RS1004.severity = none +dotnet_diagnostic.RS1005.severity = none +dotnet_diagnostic.RS1006.severity = none +dotnet_diagnostic.RS1008.severity = none +dotnet_diagnostic.RS1009.severity = none +dotnet_diagnostic.RS1010.severity = none +dotnet_diagnostic.RS1011.severity = none +dotnet_diagnostic.RS1012.severity = none +dotnet_diagnostic.RS1013.severity = none +dotnet_diagnostic.RS1014.severity = warning +# https://github.com/dotnet/roslyn/issues/26420: Enable rule RS1022 for Roslyn.sln +dotnet_diagnostic.RS1022.severity = none +# RS1024: Compare symbols correctly +dotnet_diagnostic.RS1024.severity = refactoring + +dotnet_diagnostic.AD0001.severity = error + +dotnet_diagnostic.RS0001.severity = warning +dotnet_diagnostic.RS0002.severity = warning +dotnet_diagnostic.RS0006.severity = error +dotnet_diagnostic.RS0012.severity = warning +dotnet_diagnostic.RS0014.severity = warning +dotnet_diagnostic.RS0015.severity = warning +dotnet_diagnostic.RS0016.severity = error +dotnet_diagnostic.RS0017.severity = error +dotnet_diagnostic.RS0018.severity = warning +dotnet_diagnostic.RS0022.severity = error +dotnet_diagnostic.RS0023.severity = error +dotnet_diagnostic.RS0024.severity = error +dotnet_diagnostic.RS0025.severity = error +dotnet_diagnostic.RS0026.severity = error +dotnet_diagnostic.RS0027.severity = error +# RS0040: Defaultable types should have defaultable fields +dotnet_diagnostic.RS0040.severity = none +# RS0046: Avoid the 'Opt' suffix in nullable-enabled code (too noisy right now) +dotnet_diagnostic.RS0046.severity = suggestion +# RS0047: (Suppressor) The 'Type.FullName' property is never null when using the syntax 'typeof(T).FullName' +dotnet_diagnostic.RS0047.severity = none + +# allow skipped tests, with a code fix to unskip them +dotnet_diagnostic.xUnit1004.severity = refactoring +# xUnit2006: "do not use generic Assert.Equal to test string equality" is a valid assert, but very noisy right now +dotnet_diagnostic.xUnit2006.severity = none +# xUnit2009: "do not use Assert.True to check for substrings" is a valid assert, but very noisy right now +dotnet_diagnostic.xUnit2009.severity = none +# xUnit2012: "do not use Enumerable.Any() to check if a value exists in a collection" is a valid assert, but very noisy right now +dotnet_diagnostic.xUnit2012.severity = none +# xUnit2013: "do not use Assert.Equal() to check for collection size" is a valid assert, but very noisy right now +dotnet_diagnostic.xUnit2013.severity = none +# xUnit2017: "do not use Contains() to check if a value exists in a collection" is a valid assert, but very noisy right now +dotnet_diagnostic.xUnit2017.severity = none + +# https://github.com/Microsoft/VSSDK-Analyzers/blob/master/doc/index.md +# VSSDK001: Derive from AsyncPackage +dotnet_diagnostic.VSSDK001.severity = warning +# VSSDK003: Support async tool windows +dotnet_diagnostic.VSSDK003.severity = warning +# VSSDK006: Remove suppression. https://github.com/dotnet/roslyn/issues/38471 +dotnet_diagnostic.VSSDK006.severity = none + +# VSTHRD002: Avoid problematic synchronous waits +dotnet_diagnostic.VSTHRD002.severity = none +# VSTHRD003: Avoid awaiting foreign Tasks https://github.com/dotnet/roslyn/issues/34331 +dotnet_diagnostic.VSTHRD003.severity = none +# VSTHRD103: Call async methods when in an async method +dotnet_diagnostic.VSTHRD103.severity = none +# VSTHRD010: Invoke single-threaded types on Main thread https://github.com/dotnet/roslyn/issues/29275 +dotnet_diagnostic.VSTHRD010.severity = none +# VSTHRD110: Observe result of async calls +dotnet_diagnostic.VSTHRD110.severity = none + +dotnet_diagnostic.HAA0101.severity = none +dotnet_diagnostic.HAA0102.severity = none +dotnet_diagnostic.HAA0201.severity = none +dotnet_diagnostic.HAA0202.severity = none +dotnet_diagnostic.HAA0301.severity = none +dotnet_diagnostic.HAA0302.severity = none +dotnet_diagnostic.HAA0303.severity = none +dotnet_diagnostic.HAA0401.severity = none +dotnet_diagnostic.HAA0501.severity = none +dotnet_diagnostic.HAA0502.severity = none +dotnet_diagnostic.HAA0503.severity = none +dotnet_diagnostic.HAA0506.severity = none +dotnet_diagnostic.HAA0601.severity = none +dotnet_diagnostic.HAA0602.severity = none +dotnet_diagnostic.HAA0603.severity = none +dotnet_diagnostic.HeapAnalyzerReadonlyMethodGroupAllocationRule.severity = none diff --git a/eng/config/globalconfigs/NonShipping.globalconfig b/eng/config/globalconfigs/NonShipping.globalconfig new file mode 100644 index 0000000000000..53c6ef6801131 --- /dev/null +++ b/eng/config/globalconfigs/NonShipping.globalconfig @@ -0,0 +1,25 @@ +is_global = true + +# For tests, the ConfigureAwait(true) is good enough. Either they are already running on a thread pool +# thread where ConfigureAwait(false) does nothing, or we're running the workload from an STA thread +# where we want to marshal the continuations back to it. +dotnet_diagnostic.CA2007.severity = none + +# Mark constant field as 'const' instead of static readonly - not useful for tests +dotnet_diagnostic.CA1802.severity = none + +# CodeFix providers should override GetFixAllProvider - suppress for non-shipping/test projects +dotnet_diagnostic.RS1016.severity = none +# DiagnosticId must be unique across analyzers - suppress for non-shipping/test projects +dotnet_diagnostic.RS1019.severity = none +# Configure generated code analysis - suppress for non-shipping/test projects +dotnet_diagnostic.RS1025.severity = none +# Enable concurrent execution - suppress for non-shipping/test projects +dotnet_diagnostic.RS1026.severity = none +# Do not use generic CodeAction.Create to create CodeAction - not useful for tests +dotnet_diagnostic.RS0005.severity = none +# Do not call 'GetTestAccessor()' from production code: does not apply to tests +dotnet_diagnostic.RS0043.severity = none + +# VSTHRD200: Use "Async" suffix for async methods +dotnet_diagnostic.VSTHRD200.severity = none diff --git a/eng/config/globalconfigs/Shipping.globalconfig b/eng/config/globalconfigs/Shipping.globalconfig new file mode 100644 index 0000000000000..8fc5d1432e09f --- /dev/null +++ b/eng/config/globalconfigs/Shipping.globalconfig @@ -0,0 +1,6 @@ +is_global = true + +dotnet_diagnostic.CA1802.severity = warning +dotnet_diagnostic.CA2007.severity = warning + +dotnet_diagnostic.RS0005.severity = warning diff --git a/eng/config/rulesets/NonShipping.ruleset b/eng/config/rulesets/NonShipping.ruleset deleted file mode 100644 index 29d0ee3f8b077..0000000000000 --- a/eng/config/rulesets/NonShipping.ruleset +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/eng/config/rulesets/Shipping.ruleset b/eng/config/rulesets/Shipping.ruleset deleted file mode 100644 index cda6d034d71a8..0000000000000 --- a/eng/config/rulesets/Shipping.ruleset +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/eng/targets/Imports.targets b/eng/targets/Imports.targets index 4cbf2d6f342c2..71fe5f248439d 100644 --- a/eng/targets/Imports.targets +++ b/eng/targets/Imports.targets @@ -100,11 +100,15 @@ true - - - $(RepositoryEngineeringDir)config\rulesets\Shipping.ruleset - $(RepositoryEngineeringDir)config\rulesets\NonShipping.ruleset - + + + + + + + + +