From e869fe8204657465b3fe8684279854c76ca54323 Mon Sep 17 00:00:00 2001 From: Carl Meyertons Date: Mon, 16 Oct 2023 12:17:03 -0500 Subject: [PATCH] Turn off var preferences (#1700) Turn off var idea preferences. --- .editorconfig | 6 +++++- src/Polly.Core/Hedging/HedgingResilienceStrategy.cs | 1 - src/Polly.Core/Registry/ResiliencePipelineRegistry.cs | 1 - src/Polly.Core/Retry/RetryHelper.cs | 2 ++ src/Polly.Core/Utils/Pipeline/ExternalComponent.cs | 5 +---- src/Polly.Core/Utils/Pipeline/PipelineComponentFactory.cs | 4 +--- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.editorconfig b/.editorconfig index a801866b9ac..2f385cdb222 100644 --- a/.editorconfig +++ b/.editorconfig @@ -42,4 +42,8 @@ dotnet_naming_symbols.static_fields.applicable_kinds = field dotnet_naming_symbols.static_fields.required_modifiers = static dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected dotnet_naming_style.static_prefix_style.required_prefix = -dotnet_naming_style.static_prefix_style.capitalization = pascal_case \ No newline at end of file +dotnet_naming_style.static_prefix_style.capitalization = pascal_case + +# don't have var preferences +dotnet_diagnostic.IDE0007.severity = none +dotnet_diagnostic.IDE0008.severity = none diff --git a/src/Polly.Core/Hedging/HedgingResilienceStrategy.cs b/src/Polly.Core/Hedging/HedgingResilienceStrategy.cs index 097bb6ef578..d020a4d0777 100644 --- a/src/Polly.Core/Hedging/HedgingResilienceStrategy.cs +++ b/src/Polly.Core/Hedging/HedgingResilienceStrategy.cs @@ -1,5 +1,4 @@ using System.Diagnostics.CodeAnalysis; -using Polly.Hedging.Controller; using Polly.Hedging.Utils; using Polly.Telemetry; diff --git a/src/Polly.Core/Registry/ResiliencePipelineRegistry.cs b/src/Polly.Core/Registry/ResiliencePipelineRegistry.cs index 2017894c9ef..c08f68d27fb 100644 --- a/src/Polly.Core/Registry/ResiliencePipelineRegistry.cs +++ b/src/Polly.Core/Registry/ResiliencePipelineRegistry.cs @@ -1,6 +1,5 @@ using System.ComponentModel.DataAnnotations; using System.Diagnostics.CodeAnalysis; -using Polly.Utils.Pipeline; namespace Polly.Registry; diff --git a/src/Polly.Core/Retry/RetryHelper.cs b/src/Polly.Core/Retry/RetryHelper.cs index 333a85d9b88..ec6dce016eb 100644 --- a/src/Polly.Core/Retry/RetryHelper.cs +++ b/src/Polly.Core/Retry/RetryHelper.cs @@ -112,6 +112,7 @@ private static TimeSpan DecorrelatedJitterBackoffV2(int attempt, TimeSpan baseDe return TimeSpan.FromTicks((long)Math.Min(formulaIntrinsicValue * RpScalingFactor * targetTicksFirstDelay, maxTimeSpanDouble)); } +#pragma warning disable IDE0047 // Remove unnecessary parentheses which offer less mental gymnastics private static TimeSpan ApplyJitter(TimeSpan delay, Func randomizer) { var offset = (delay.TotalMilliseconds * JitterFactor) / 2; @@ -120,4 +121,5 @@ private static TimeSpan ApplyJitter(TimeSpan delay, Func randomizer) return TimeSpan.FromMilliseconds(newDelay); } +#pragma warning restore IDE0047 // Remove unnecessary parentheses which offer less mental gymnastics } diff --git a/src/Polly.Core/Utils/Pipeline/ExternalComponent.cs b/src/Polly.Core/Utils/Pipeline/ExternalComponent.cs index 75e7e375a30..16cb6f120d9 100644 --- a/src/Polly.Core/Utils/Pipeline/ExternalComponent.cs +++ b/src/Polly.Core/Utils/Pipeline/ExternalComponent.cs @@ -1,7 +1,4 @@ -using System; -using System.Threading.Tasks; - -namespace Polly.Utils.Pipeline; +namespace Polly.Utils.Pipeline; [DebuggerDisplay("{Component}")] internal class ExternalComponent : PipelineComponent diff --git a/src/Polly.Core/Utils/Pipeline/PipelineComponentFactory.cs b/src/Polly.Core/Utils/Pipeline/PipelineComponentFactory.cs index 5c992295fc8..a671dc7e0f1 100644 --- a/src/Polly.Core/Utils/Pipeline/PipelineComponentFactory.cs +++ b/src/Polly.Core/Utils/Pipeline/PipelineComponentFactory.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Polly.Telemetry; +using Polly.Telemetry; namespace Polly.Utils.Pipeline;