From a779b1c53cc3832c1cc0acbaa6cd65bf969e2ca9 Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Sun, 1 Nov 2020 18:08:13 +0000 Subject: [PATCH 1/3] Enable IDE0048: AddRequiredParentheses https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0047-ide0048 --- .globalconfig | 2 +- .../commands/management/Computer.cs | 6 +++--- .../commands/management/GetComputerInfoCommand.cs | 10 +++++----- .../commands/management/TestConnectionCommand.cs | 2 +- .../commands/utility/AddType.cs | 2 +- .../commands/utility/GetRandomCommand.cs | 6 +++--- .../commands/utility/Set-PSBreakpoint.cs | 4 ++-- .../host/msh/ConsoleHostUserInterface.cs | 6 +++--- .../DotNetCode/Eventing/Reader/NativeWrapper.cs | 4 ++-- .../DscSupport/CimDSCParser.cs | 2 +- .../FormatAndOutput/common/ColumnWidthManager.cs | 2 +- .../FormatAndOutput/common/OutputQueue.cs | 4 ++-- .../FormatAndOutput/common/TableWriter.cs | 2 +- .../cimSupport/cmdletization/ScriptWriter.cs | 2 +- .../engine/COM/ComInvoker.cs | 12 ++++++------ .../engine/CmdletParameterBinderController.cs | 4 ++-- .../engine/CommandSearcher.cs | 4 ++-- .../engine/CompiledCommandParameter.cs | 2 +- .../engine/LanguagePrimitives.cs | 10 +++++----- .../engine/Modules/PSModuleInfo.cs | 6 +++--- .../engine/MshCommandRuntime.cs | 2 +- .../engine/MshMemberInfo.cs | 4 ++-- .../engine/NativeCommandParameterBinder.cs | 2 +- .../engine/PSVersionInfo.cs | 2 +- .../engine/hostifaces/Connection.cs | 2 +- .../engine/interpreter/CallInstruction.cs | 2 +- .../engine/interpreter/ControlFlowInstructions.cs | 2 +- .../engine/interpreter/LightCompiler.cs | 4 ++-- .../engine/parser/Position.cs | 2 +- .../engine/parser/ast.cs | 2 +- .../engine/parser/tokenizer.cs | 4 ++-- src/System.Management.Automation/engine/regex.cs | 4 ++-- .../clientremotesessionprotocolstatemachine.cs | 4 ++-- .../engine/remoting/commands/DebugJob.cs | 2 +- .../engine/remoting/commands/WaitJob.cs | 2 +- .../engine/remoting/fanin/WSManTransportManager.cs | 2 +- .../engine/runtime/Binding/Binders.cs | 6 +++--- .../engine/runtime/CompiledScriptBlock.cs | 2 +- .../engine/serialization.cs | 6 +++--- .../logging/LogProvider.cs | 2 +- .../namespaces/LocationGlobber.cs | 4 ++-- .../security/SecureStringHelper.cs | 4 ++-- src/System.Management.Automation/utils/PsUtils.cs | 2 +- 43 files changed, 80 insertions(+), 80 deletions(-) diff --git a/.globalconfig b/.globalconfig index 33d6fe31e7e..a3157cf2991 100644 --- a/.globalconfig +++ b/.globalconfig @@ -868,7 +868,7 @@ dotnet_diagnostic.IDE0046.severity = silent dotnet_diagnostic.IDE0047.severity = silent # IDE0048: AddRequiredParentheses -dotnet_diagnostic.IDE0048.severity = suggestion +dotnet_diagnostic.IDE0048.severity = warning # IDE0049: PreferBuiltInOrFrameworkType dotnet_diagnostic.IDE0049.severity = silent diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs index 75776b1c294..c5d460327ae 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs @@ -1834,7 +1834,7 @@ internal static string GetRandomPassword(int passwordLength) for (int i = 0; i < passwordLength; i++) { - chars[i] = (char)(randomBytes[i] % allowedCharsCount + charMin); + chars[i] = (char)((randomBytes[i] % allowedCharsCount) + charMin); } return new string(chars); @@ -2013,8 +2013,8 @@ internal static bool IsComputerNameValid(string computerName) foreach (char t in computerName) { - if (t >= 'A' && t <= 'Z' || - t >= 'a' && t <= 'z') + if ((t >= 'A' && t <= 'Z') || + (t >= 'a' && t <= 'z')) { allDigits = false; continue; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs index f478a18e421..a76025697be 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs @@ -1159,13 +1159,13 @@ internal static DateTime UnixSecondsToDateTime(long seconds) return DateTimeOffset.FromUnixTimeSeconds(seconds).DateTime; #else const int DaysPerYear = 365; - const int DaysPer4Years = DaysPerYear * 4 + 1; - const int DaysPer100Years = DaysPer4Years * 25 - 1; - const int DaysPer400Years = DaysPer100Years * 4 + 1; - const int DaysTo1970 = DaysPer400Years * 4 + DaysPer100Years * 3 + DaysPer4Years * 17 + DaysPerYear; + const int DaysPer4Years = (DaysPerYear * 4) + 1; + const int DaysPer100Years = (DaysPer4Years * 25) - 1; + const int DaysPer400Years = (DaysPer100Years * 4) + 1; + const int DaysTo1970 = (DaysPer400Years * 4) + (DaysPer100Years * 3) + (DaysPer4Years * 17) + DaysPerYear; const long UnixEpochTicks = TimeSpan.TicksPerDay * DaysTo1970; - long ticks = seconds * TimeSpan.TicksPerSecond + UnixEpochTicks; + long ticks = (seconds * TimeSpan.TicksPerSecond) + UnixEpochTicks; return new DateTimeOffset(ticks, TimeSpan.Zero).DateTime; #endif diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs index 6875f7a2164..c85f0ce0034 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs @@ -805,7 +805,7 @@ private byte[] GetSendBuffer(int bufferSize) for (int i = 0; i < bufferSize; i++) { - sendBuffer[i] = (byte)((int)'a' + i % 23); + sendBuffer[i] = (byte)((int)'a' + (i % 23)); } if (bufferSize == DefaultSendBufferSize && s_DefaultSendBuffer == null) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs index d3c61582de9..c448c3310a2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs @@ -1289,7 +1289,7 @@ private string BuildErrorMessage(Diagnostic diagnisticRecord) var errorLineString = textLines[errorLineNumber].ToString(); var errorPosition = lineSpan.StartLinePosition.Character; - StringBuilder sb = new StringBuilder(diagnisticMessage.Length + errorLineString.Length * 2 + 4); + StringBuilder sb = new StringBuilder(diagnisticMessage.Length + (errorLineString.Length * 2) + 4); sb.AppendLine(diagnisticMessage); sb.AppendLine(errorLineString); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs index 7b10beaa412..4f1cadd4c16 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs @@ -324,7 +324,7 @@ private double GetRandomDouble(double minValue, double maxValue) do { double r = Generator.NextDouble(); - randomNumber = minValue + r * maxValue - r * minValue; + randomNumber = minValue + (r * maxValue) - (r * minValue); } while (randomNumber >= maxValue); } @@ -333,7 +333,7 @@ private double GetRandomDouble(double minValue, double maxValue) do { double r = Generator.NextDouble(); - randomNumber = minValue + r * diff; + randomNumber = minValue + (r * diff); diff = diff * r; } while (randomNumber >= maxValue); @@ -385,7 +385,7 @@ private Int64 GetRandomInt64(Int64 minValue, Int64 maxValue) randomUint64 &= mask; } while (uint64Diff <= randomUint64); - double randomNumber = minValue * 1.0 + randomUint64 * 1.0; + double randomNumber = (minValue * 1.0) + (randomUint64 * 1.0); return (Int64)randomNumber; } diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs index e628da48244..3179477b1eb 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs @@ -88,8 +88,8 @@ protected override void BeginProcessing() // whether the RemoteScript debug option is selected. if (this.Context.InternalHost.ExternalHost is System.Management.Automation.Remoting.ServerRemoteHost && ((this.Context.CurrentRunspace == null) || (this.Context.CurrentRunspace.Debugger == null) || - ((this.Context.CurrentRunspace.Debugger.DebugMode & DebugModes.RemoteScript) != DebugModes.RemoteScript) && - (this.Context.CurrentRunspace.Debugger.DebugMode != DebugModes.None))) + (((this.Context.CurrentRunspace.Debugger.DebugMode & DebugModes.RemoteScript) != DebugModes.RemoteScript) && + (this.Context.CurrentRunspace.Debugger.DebugMode != DebugModes.None)))) { ThrowTerminatingError( new ErrorRecord( diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index ac18b3c97e4..dd47ffb9c5d 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -2006,8 +2006,8 @@ internal string ReadLineWithTabCompletion(Executor exec) // the user hit tab up to the current cursor position after writing the completed text. int deltaInput = - (endOfInputCursorPos.Y * screenBufferSize.Width + endOfInputCursorPos.X) - - (endOfCompletionCursorPos.Y * screenBufferSize.Width + endOfCompletionCursorPos.X); + ((endOfInputCursorPos.Y * screenBufferSize.Width) + endOfInputCursorPos.X) + - ((endOfCompletionCursorPos.Y * screenBufferSize.Width) + endOfCompletionCursorPos.X); if (deltaInput > 0) { @@ -2066,7 +2066,7 @@ private void SendLeftArrows(int length) up.Data.Keyboard.ExtraInfo = IntPtr.Zero; inputs[2 * i] = down; - inputs[2 * i + 1] = up; + inputs[(2 * i) + 1] = up; } ConsoleControl.MimicKeyPress(inputs); diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs index 8858b067f8a..378c6d5597b 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs @@ -1419,7 +1419,7 @@ public static Array ConvertToFileTimeArray(UnsafeNativeMethods.EvtVariant val) for (int i = 0; i < val.Count; i++) { array[i] = DateTime.FromFileTime(Marshal.ReadInt64(ptr)); - ptr = new IntPtr((Int64)ptr + 8 * sizeof(byte)); // FILETIME values are 8 bytes + ptr = new IntPtr((Int64)ptr + (8 * sizeof(byte))); // FILETIME values are 8 bytes } return array; @@ -1441,7 +1441,7 @@ public static Array ConvertToSysTimeArray(UnsafeNativeMethods.EvtVariant val) { UnsafeNativeMethods.SystemTime sysTime = Marshal.PtrToStructure(ptr); array[i] = new DateTime(sysTime.Year, sysTime.Month, sysTime.Day, sysTime.Hour, sysTime.Minute, sysTime.Second, sysTime.Milliseconds); - ptr = new IntPtr((Int64)ptr + 16 * sizeof(byte)); // SystemTime values are 16 bytes + ptr = new IntPtr((Int64)ptr + (16 * sizeof(byte))); // SystemTime values are 16 bytes } return array; diff --git a/src/System.Management.Automation/DscSupport/CimDSCParser.cs b/src/System.Management.Automation/DscSupport/CimDSCParser.cs index 6d264f76fc4..277e2d58d4e 100644 --- a/src/System.Management.Automation/DscSupport/CimDSCParser.cs +++ b/src/System.Management.Automation/DscSupport/CimDSCParser.cs @@ -3626,7 +3626,7 @@ public static string GetDSCResourceUsageString(DynamicKeyword keyword) } var propVal = prop.Value; - if (listKeyProperties && propVal.IsKey || !listKeyProperties && !propVal.IsKey) + if ((listKeyProperties && propVal.IsKey) || (!listKeyProperties && !propVal.IsKey)) { usageString.Append(propVal.Mandatory ? " " : " [ "); usageString.Append(prop.Key); diff --git a/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs b/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs index d2e44c4ad60..b7c384047ff 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs @@ -182,7 +182,7 @@ private int CurrentTableWidth(Span columnWidths) } } - return sum + _separatorWidth * (visibleColumns - 1); + return sum + (_separatorWidth * (visibleColumns - 1)); } /// diff --git a/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs b/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs index 1545f456e12..ee75c073261 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs @@ -69,9 +69,9 @@ internal List Add(PacketInfoData o) } // STATE TRANSITION: we are processing and we stop - if (_processingGroup && + if ((_processingGroup && ((o is GroupEndData) || - (_objectCount > 0) && (_currentObjectCount >= _objectCount)) || + ((_objectCount > 0) && (_currentObjectCount >= _objectCount)))) || ((_groupingTimer != null) && (_groupingTimer.Elapsed > _groupingDuration)) ) { diff --git a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs index 54aaa9438c5..05d20600a7d 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs @@ -64,7 +64,7 @@ internal static int ComputeWideViewBestItemsPerRowFit(int stringLen, int screenC // would we fit with one more column? int nextValue = columnNumber + 1; // compute the width if we added the extra column - int width = stringLen * nextValue + (nextValue - 1) * ScreenInfo.separatorCharacterCount; + int width = (stringLen * nextValue) + ((nextValue - 1) * ScreenInfo.separatorCharacterCount); if (width >= screenColumns) { diff --git a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs index 3757319c9ab..db07d32e80e 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs @@ -908,7 +908,7 @@ private static void EnsureOrderOfPositionalParameters( if ((maxBeforePosition >= 0) && (minAfterPosition <= maxBeforePosition)) { - int delta = (1001 - minAfterPosition % 1000); + int delta = (1001 - (minAfterPosition % 1000)); foreach (ParameterMetadata afterParameter in afterParameters.Values) { foreach (ParameterSetMetadata afterParameterSet in afterParameter.ParameterSets.Values) diff --git a/src/System.Management.Automation/engine/COM/ComInvoker.cs b/src/System.Management.Automation/engine/COM/ComInvoker.cs index 3834be3de8e..8214a50b0e2 100644 --- a/src/System.Management.Automation/engine/COM/ComInvoker.cs +++ b/src/System.Management.Automation/engine/COM/ComInvoker.cs @@ -82,7 +82,7 @@ private static unsafe IntPtr NewVariantArray(int length) for (int i = 0; i < length; i++) { - IntPtr currentVarPtr = variantArray + s_variantSize * i; + IntPtr currentVarPtr = variantArray + (s_variantSize * i); var currentVar = (Variant*)currentVarPtr; currentVar->_typeUnion._vt = (ushort)VarEnum.VT_EMPTY; } @@ -157,7 +157,7 @@ internal static object Invoke(IDispatch target, int dispId, object[] args, bool[ { // !! The arguments should be in REVERSED order!! int actualIndex = argCount - i - 1; - IntPtr varArgPtr = variantArgArray + s_variantSize * actualIndex; + IntPtr varArgPtr = variantArgArray + (s_variantSize * actualIndex); // If need to pass by ref, create a by-ref variant if (byRef != null && byRef[i]) @@ -169,7 +169,7 @@ internal static object Invoke(IDispatch target, int dispId, object[] args, bool[ } // Create a VARIANT that the by-ref VARIANT points to - IntPtr tmpVarPtr = tmpVariants + s_variantSize * refIndex; + IntPtr tmpVarPtr = tmpVariants + (s_variantSize * refIndex); Marshal.GetNativeVariantForObject(args[i], tmpVarPtr); // Create the by-ref VARIANT @@ -266,7 +266,7 @@ internal static object Invoke(IDispatch target, int dispId, object[] args, bool[ // If need to pass by ref, back propagate if (byRef != null && byRef[i]) { - args[i] = Marshal.GetObjectForNativeVariant(variantArgArray + s_variantSize * actualIndex); + args[i] = Marshal.GetObjectForNativeVariant(variantArgArray + (s_variantSize * actualIndex)); } } } @@ -280,7 +280,7 @@ internal static object Invoke(IDispatch target, int dispId, object[] args, bool[ { for (int i = 0; i < argCount; i++) { - VariantClear(variantArgArray + s_variantSize * i); + VariantClear(variantArgArray + (s_variantSize * i)); } Marshal.FreeCoTaskMem(variantArgArray); @@ -297,7 +297,7 @@ internal static object Invoke(IDispatch target, int dispId, object[] args, bool[ { for (int i = 0; i < refCount; i++) { - VariantClear(tmpVariants + s_variantSize * i); + VariantClear(tmpVariants + (s_variantSize * i)); } Marshal.FreeCoTaskMem(tmpVariants); diff --git a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs index eeccc290883..5295eed3a1c 100644 --- a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs +++ b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs @@ -2564,8 +2564,8 @@ private int ValidateParameterSets(bool prePipelineInput, bool setDefault) // If the valid parameter set is the default parameter set, or if the default // parameter set has been defined and one of the valid parameter sets is // the default parameter set, then use the default parameter set. - else if (!prePipelineInput && - validSetIsDefault || + else if ((!prePipelineInput && + validSetIsDefault) || (hasDefaultSetDefined && (_currentParameterSetFlag & defaultParameterSetFlag) != 0)) { // NTRAID#Windows Out Of Band Releases-2006/02/14-928660-JonN diff --git a/src/System.Management.Automation/engine/CommandSearcher.cs b/src/System.Management.Automation/engine/CommandSearcher.cs index d3a1033c932..a3f0a8a120d 100644 --- a/src/System.Management.Automation/engine/CommandSearcher.cs +++ b/src/System.Management.Automation/engine/CommandSearcher.cs @@ -1021,8 +1021,8 @@ private bool ShouldSkipCommandResolutionForConstrainedLanguage(CommandInfo? resu { foreach (CmdletInfo cmdlet in cmdletList) { - if (cmdletMatcher != null && - cmdletMatcher.IsMatch(cmdlet.Name) || + if ((cmdletMatcher != null && + cmdletMatcher.IsMatch(cmdlet.Name)) || (_commandResolutionOptions.HasFlag(SearchResolutionOptions.FuzzyMatch) && FuzzyMatcher.IsFuzzyMatch(cmdlet.Name, _commandName))) { diff --git a/src/System.Management.Automation/engine/CompiledCommandParameter.cs b/src/System.Management.Automation/engine/CompiledCommandParameter.cs index 90011fbde74..ecb9ea337a2 100644 --- a/src/System.Management.Automation/engine/CompiledCommandParameter.cs +++ b/src/System.Management.Automation/engine/CompiledCommandParameter.cs @@ -63,7 +63,7 @@ internal CompiledCommandParameter(RuntimeDefinedParameter runtimeDefinedParamete // and disabled parameter attributes. We should ignore those attributes. // When processing non-dynamic parameters, the experimental attributes and disabled parameter // attributes have already been filtered out when constructing the RuntimeDefinedParameter. - if (attribute is ExperimentalAttribute || attribute is ParameterAttribute param && param.ToHide) + if (attribute is ExperimentalAttribute || (attribute is ParameterAttribute param && param.ToHide)) { continue; } diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 5929a5637e9..7cb7c2668aa 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -4331,7 +4331,7 @@ public override int GetHashCode() { // To prevent to/from == from/to, multiply and add rather than use // an operation that won't overflow, like bitwise xor. - return from.GetHashCode() + 37 * to.GetHashCode(); + return from.GetHashCode() + (37 * to.GetHashCode()); } } @@ -5180,8 +5180,8 @@ private static bool ProjectedTypeMatchesTargetType(Type sourceType, Type targetT var sourceTypeDef = sourceType.GetGenericTypeDefinition(); bool isOutParameter = matchContext == TypeMatchingContext.OutParameterType; - if (targetType.IsByRef && sourceTypeDef == (isOutParameter ? typeof(PSOutParameter<>) : typeof(PSReference<>)) || - targetType.IsPointer && sourceTypeDef == typeof(PSPointer<>)) + if ((targetType.IsByRef && sourceTypeDef == (isOutParameter ? typeof(PSOutParameter<>) : typeof(PSReference<>))) || + (targetType.IsPointer && sourceTypeDef == typeof(PSPointer<>))) { // For ref/out parameter types and pointer types, the element types need to match exactly. if (targetType.GetElementType() == sourceType.GenericTypeArguments[0]) @@ -5195,8 +5195,8 @@ private static bool ProjectedTypeMatchesTargetType(Type sourceType, Type targetT } if (targetType == sourceType || - targetType == typeof(void) && sourceType == typeof(VOID) || - targetType == typeof(TypedReference) && sourceType == typeof(PSTypedReference)) + (targetType == typeof(void) && sourceType == typeof(VOID)) || + (targetType == typeof(TypedReference) && sourceType == typeof(PSTypedReference))) { matchExactly = true; return true; diff --git a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs index 033382a565b..75c6b305d3c 100644 --- a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs +++ b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs @@ -1627,17 +1627,17 @@ public int GetHashCode(PSModuleInfo obj) result = 23; if (obj.Name != null) { - result = result * 17 + obj.Name.GetHashCode(); + result = (result * 17) + obj.Name.GetHashCode(); } if (obj.Guid != Guid.Empty) { - result = result * 17 + obj.Guid.GetHashCode(); + result = (result * 17) + obj.Guid.GetHashCode(); } if (obj.Version != null) { - result = result * 17 + obj.Version.GetHashCode(); + result = (result * 17) + obj.Version.GetHashCode(); } } diff --git a/src/System.Management.Automation/engine/MshCommandRuntime.cs b/src/System.Management.Automation/engine/MshCommandRuntime.cs index 2816dd42f13..22984a79b14 100644 --- a/src/System.Management.Automation/engine/MshCommandRuntime.cs +++ b/src/System.Management.Automation/engine/MshCommandRuntime.cs @@ -2287,7 +2287,7 @@ internal void ThrowIfWriteNotPermitted(bool needsToWriteToPipeline) { if (this.PipelineProcessor == null || _thisCommand != this.PipelineProcessor._permittedToWrite - || needsToWriteToPipeline && !this.PipelineProcessor._permittedToWriteToPipeline + || (needsToWriteToPipeline && !this.PipelineProcessor._permittedToWriteToPipeline) || Thread.CurrentThread != this.PipelineProcessor._permittedToWriteThread ) { diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index e8ba8fea963..75c4cb1d2cb 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -1996,8 +1996,8 @@ public override int GetHashCode() { int result = 61; - result = result * 397 + (MethodTargetType != null ? MethodTargetType.GetHashCode() : 0); - result = result * 397 + ParameterTypes.SequenceGetHashCode(); + result = (result * 397) + (MethodTargetType != null ? MethodTargetType.GetHashCode() : 0); + result = (result * 397) + ParameterTypes.SequenceGetHashCode(); return result; } diff --git a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs index 41b9c2eb6fe..70aff81e6f3 100644 --- a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs +++ b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs @@ -169,7 +169,7 @@ private void AppendOneNativeArgument(ExecutionContext context, object obj, Array { IEnumerator list = LanguagePrimitives.GetEnumerator(obj); - Diagnostics.Assert((argArrayAst == null) || obj is object[] && ((object[])obj).Length == argArrayAst.Elements.Count, "array argument and ArrayLiteralAst differ in number of elements"); + Diagnostics.Assert((argArrayAst == null) || (obj is object[] && ((object[])obj).Length == argArrayAst.Elements.Count), "array argument and ArrayLiteralAst differ in number of elements"); int currentElement = -1; string separator = string.Empty; diff --git a/src/System.Management.Automation/engine/PSVersionInfo.cs b/src/System.Management.Automation/engine/PSVersionInfo.cs index f3d4b7dc2a3..9037afa5000 100644 --- a/src/System.Management.Automation/engine/PSVersionInfo.cs +++ b/src/System.Management.Automation/engine/PSVersionInfo.cs @@ -778,7 +778,7 @@ private static bool TryParseVersion(string version, ref VersionResult result) return false; } - if (preLabel != null && !Regex.IsMatch(preLabel, LabelUnitRegEx) || + if ((preLabel != null && !Regex.IsMatch(preLabel, LabelUnitRegEx)) || (buildLabel != null && !Regex.IsMatch(buildLabel, LabelUnitRegEx))) { result.SetFailure(ParseFailureKind.FormatException); diff --git a/src/System.Management.Automation/engine/hostifaces/Connection.cs b/src/System.Management.Automation/engine/hostifaces/Connection.cs index 0fb8931e4da..36cc9ec3fa2 100644 --- a/src/System.Management.Automation/engine/hostifaces/Connection.cs +++ b/src/System.Management.Automation/engine/hostifaces/Connection.cs @@ -943,7 +943,7 @@ internal void UpdateRunspaceAvailability(PipelineState pipelineState, bool raise case PipelineState.Completed: case PipelineState.Stopped: case PipelineState.Failed: - if (this.InNestedPrompt || !(this is RemoteRunspace) && this.Debugger.InBreakpoint) + if (this.InNestedPrompt || (!(this is RemoteRunspace) && this.Debugger.InBreakpoint)) { this.RunspaceAvailability = RunspaceAvailability.AvailableForNestedCommand; } diff --git a/src/System.Management.Automation/engine/interpreter/CallInstruction.cs b/src/System.Management.Automation/engine/interpreter/CallInstruction.cs index bcf3acc8251..005f0c957fa 100644 --- a/src/System.Management.Automation/engine/interpreter/CallInstruction.cs +++ b/src/System.Management.Automation/engine/interpreter/CallInstruction.cs @@ -57,7 +57,7 @@ public static CallInstruction Create(MethodInfo info, ParameterInfo[] parameters return GetArrayAccessor(info, argumentCount); } - if (info is DynamicMethod || !info.IsStatic && info.DeclaringType.IsValueType) + if (info is DynamicMethod || (!info.IsStatic && info.DeclaringType.IsValueType)) { return new MethodInfoCallInstruction(info, argumentCount); } diff --git a/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs b/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs index 56aca65df37..4db43489ba5 100644 --- a/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs +++ b/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs @@ -291,7 +291,7 @@ internal static GotoInstruction Create(int labelIndex, bool hasResult, bool hasV { if (labelIndex < CacheSize) { - var index = Variants * labelIndex | (hasResult ? 2 : 0) | (hasValue ? 1 : 0); + var index = (Variants * labelIndex) | (hasResult ? 2 : 0) | (hasValue ? 1 : 0); return s_cache[index] ?? (s_cache[index] = new GotoInstruction(labelIndex, hasResult, hasValue)); } diff --git a/src/System.Management.Automation/engine/interpreter/LightCompiler.cs b/src/System.Management.Automation/engine/interpreter/LightCompiler.cs index e5d399bf480..404cc7b85a9 100644 --- a/src/System.Management.Automation/engine/interpreter/LightCompiler.cs +++ b/src/System.Management.Automation/engine/interpreter/LightCompiler.cs @@ -799,7 +799,7 @@ private void CompileBinaryExpression(Expression expr) private void CompileEqual(Expression left, Expression right) { Debug.Assert(left.Type == right.Type || - !left.Type.IsValueType && !right.Type.IsValueType); + (!left.Type.IsValueType && !right.Type.IsValueType)); Compile(left); Compile(right); _instructions.EmitEqual(left.Type); @@ -808,7 +808,7 @@ private void CompileEqual(Expression left, Expression right) private void CompileNotEqual(Expression left, Expression right) { Debug.Assert(left.Type == right.Type || - !left.Type.IsValueType && !right.Type.IsValueType); + (!left.Type.IsValueType && !right.Type.IsValueType)); Compile(left); Compile(right); _instructions.EmitNotEqual(left.Type); diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index e9f273fed14..a0a38ac5224 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -177,7 +177,7 @@ internal static string VerboseMessage(IScriptExtent position) bool needsSuffixDots = false; int lineLength = sourceLine.Length; - var sb = new StringBuilder(sourceLine.Length * 2 + 4); + var sb = new StringBuilder((sourceLine.Length * 2) + 4); if (lineLength > maxLineLength) { // Need to truncate - include as much of the error as we can, but with diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index 92f54515995..494a8fbce02 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -1364,7 +1364,7 @@ internal override AstVisitAction InternalVisit(AstVisitor visitor) bool IParameterMetadataProvider.HasAnyScriptBlockAttributes() { - return Attributes.Count > 0 || ParamBlock != null && ParamBlock.Attributes.Count > 0; + return Attributes.Count > 0 || (ParamBlock != null && ParamBlock.Attributes.Count > 0); } RuntimeDefinedParameterDictionary IParameterMetadataProvider.GetParameterMetadata(bool automaticPositions, ref bool usesCmdletBinding) diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index 7a935115bac..61751ca899f 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -1593,8 +1593,8 @@ private static char GetCharsFromUtf32(uint codepoint, out char lowSurrogate) else { Diagnostics.Assert((codepoint > 0x0000FFFF) && (codepoint <= 0x0010FFFF), "Codepoint is out of range for a surrogate pair"); - lowSurrogate = (char)((codepoint - 0x00010000) % 0x0400 + 0xDC00); - return (char)((codepoint - 0x00010000) / 0x0400 + 0xD800); + lowSurrogate = (char)(((codepoint - 0x00010000) % 0x0400) + 0xDC00); + return (char)(((codepoint - 0x00010000) / 0x0400) + 0xD800); } } diff --git a/src/System.Management.Automation/engine/regex.cs b/src/System.Management.Automation/engine/regex.cs index c867f355158..824278bc162 100644 --- a/src/System.Management.Automation/engine/regex.cs +++ b/src/System.Management.Automation/engine/regex.cs @@ -230,7 +230,7 @@ internal static string Escape(string pattern, char[] charsNotToEscape) return pattern; } - Span temp = pattern.Length < StackAllocThreshold ? stackalloc char[pattern.Length * 2 + 1] : new char[pattern.Length * 2 + 1]; + Span temp = pattern.Length < StackAllocThreshold ? stackalloc char[(pattern.Length * 2) + 1] : new char[(pattern.Length * 2) + 1]; int tempIndex = 0; for (int i = 0; i < pattern.Length; i++) @@ -790,7 +790,7 @@ internal static RegexOptions TranslateWildcardOptionsIntoRegexOptions(WildcardOp protected override void BeginWildcardPattern(WildcardPattern pattern) { - _regexPattern = new StringBuilder(pattern.Pattern.Length * 2 + 2); + _regexPattern = new StringBuilder((pattern.Pattern.Length * 2) + 2); _regexPattern.Append('^'); _regexOptions = TranslateWildcardOptionsIntoRegexOptions(pattern.Options); diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs index ec55f22fc22..c3b5aa21a9d 100644 --- a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs +++ b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs @@ -359,8 +359,8 @@ private void HandleKeyExchangeTimeout(object sender) /// Event args. private void SetStateToClosedHandler(object sender, RemoteSessionStateMachineEventArgs eventArgs) { - Dbg.Assert(_state == RemoteSessionState.NegotiationReceived && - eventArgs.StateEvent == RemoteSessionEvent.NegotiationFailed || + Dbg.Assert((_state == RemoteSessionState.NegotiationReceived && + eventArgs.StateEvent == RemoteSessionEvent.NegotiationFailed) || eventArgs.StateEvent == RemoteSessionEvent.SendFailed || eventArgs.StateEvent == RemoteSessionEvent.ReceiveFailed || eventArgs.StateEvent == RemoteSessionEvent.NegotiationTimeout || diff --git a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs index 979912619f2..1a041801dbd 100644 --- a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs @@ -431,7 +431,7 @@ private Job GetJobById(int id) } if ((jobs1.Count > 1) || - (jobs1.Count == 1) && (job2 != null)) + ((jobs1.Count == 1) && (job2 != null))) { ThrowTerminatingError( new ErrorRecord( diff --git a/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs b/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs index 796e97513bd..80c5549a919 100644 --- a/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs @@ -149,7 +149,7 @@ private void HandleJobStateChangedEvent(object source, JobStateEventArgs eventAr // Wait should wait until a job is in a persistent state, OR if the force parameter // is specified, until the job is in a finished state, which is a subset of // persistent states. - if (!Force && job.IsPersistentState(eventArgs.JobStateInfo.State) || (Force && job.IsFinishedState(eventArgs.JobStateInfo.State))) + if ((!Force && job.IsPersistentState(eventArgs.JobStateInfo.State)) || (Force && job.IsFinishedState(eventArgs.JobStateInfo.State))) { if (!job.IsFinishedState(eventArgs.JobStateInfo.State)) { diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs index 813d5d5b375..10f8397bbd1 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs @@ -395,7 +395,7 @@ private void ProcessShellData(string data) int decimalIndex = timeoutString.IndexOf('.'); try { - int timeout = Convert.ToInt32(timeoutString.Substring(2, decimalIndex - 2), NumberFormatInfo.InvariantInfo) * 1000 + Convert.ToInt32(timeoutString.Substring(decimalIndex + 1, 3), NumberFormatInfo.InvariantInfo); + int timeout = (Convert.ToInt32(timeoutString.Substring(2, decimalIndex - 2), NumberFormatInfo.InvariantInfo) * 1000) + Convert.ToInt32(timeoutString.Substring(decimalIndex + 1, 3), NumberFormatInfo.InvariantInfo); if (settingIdleTimeout) { ConnectionInfo.IdleTimeout = timeout; diff --git a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs index 70790906e8a..9f429d2f560 100644 --- a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs +++ b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs @@ -4569,7 +4569,7 @@ public override DynamicMetaObject FallbackSetIndex( return Defer(indexes.Prepend(target).Append(value).ToArray()).WriteToDebugLog(this); } - if (target.Value is PSObject && (PSObject.Base(target.Value) != target.Value) || + if ((target.Value is PSObject && (PSObject.Base(target.Value) != target.Value)) || indexes.Any(mo => mo.Value is PSObject && (PSObject.Base(mo.Value) != mo.Value))) { return this.DeferForPSObject(indexes.Prepend(target).Append(value).ToArray()).WriteToDebugLog(this); @@ -6909,8 +6909,8 @@ internal static DynamicMetaObject InvokeDotNetMethod( // to wrap exceptions - this is very much a special case to help error // propagation and ensure errors are attributed to the correct code (the // cmdlet invoked, not the method call from some proxy.) - if (methodInfo.DeclaringType == typeof(SteppablePipeline) - && (methodInfo.Name.Equals("Begin", StringComparison.Ordinal)) + if ((methodInfo.DeclaringType == typeof(SteppablePipeline) + && (methodInfo.Name.Equals("Begin", StringComparison.Ordinal))) || methodInfo.Name.Equals("Process", StringComparison.Ordinal) || methodInfo.Name.Equals("End", StringComparison.Ordinal)) { diff --git a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs index f441a84470c..11d8f88ec3b 100644 --- a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs +++ b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs @@ -2024,7 +2024,7 @@ public static string Match(string text) // LCG comes from a trivial (bad) random number generator, // but it's sufficient for us - the hashes for our patterns // are unique, and processing of 2200 files found no false matches. - runningHash[j] = LCG * runningHash[j - 1] + h; + runningHash[j] = (LCG * runningHash[j - 1]) + h; } runningHash[0] = h; diff --git a/src/System.Management.Automation/engine/serialization.cs b/src/System.Management.Automation/engine/serialization.cs index de5d107404c..7dd10319137 100644 --- a/src/System.Management.Automation/engine/serialization.cs +++ b/src/System.Management.Automation/engine/serialization.cs @@ -2841,7 +2841,7 @@ private static string EncodeString(string s, int indexOfFirstEncodableCharacter) Dbg.Assert(indexOfFirstEncodableCharacter < s.Length, "Caller should verify validity of indexOfFirstEncodableCharacter"); int slen = s.Length; - char[] result = new char[indexOfFirstEncodableCharacter + (slen - indexOfFirstEncodableCharacter) * 7]; + char[] result = new char[indexOfFirstEncodableCharacter + ((slen - indexOfFirstEncodableCharacter) * 7)]; s.CopyTo(0, result, 0, indexOfFirstEncodableCharacter); int rlen = indexOfFirstEncodableCharacter; @@ -3802,7 +3802,7 @@ private void ReadTypeNames(PSObject dso) // allocating much more memory than the length of the xml string // We have to account for that to limit that to remoting quota and protect against OOM. _context.LogExtraMemoryUsage( - typeNames.Key.Length * sizeof(char) // Key is shared among the cloned and original object + (typeNames.Key.Length * sizeof(char)) // Key is shared among the cloned and original object // but the list of strings isn't. The expression to the left // is roughly the size of memory the list of strings occupies - 29 // size of in UTF8 encoding @@ -5710,7 +5710,7 @@ private void CleanUp() } _dictionary = alive; - _cleanupTriggerSize = initialCleanupTriggerSize + this.Count * 2; + _cleanupTriggerSize = initialCleanupTriggerSize + (this.Count * 2); } } diff --git a/src/System.Management.Automation/logging/LogProvider.cs b/src/System.Management.Automation/logging/LogProvider.cs index a46f181b262..d94a25d18cc 100644 --- a/src/System.Management.Automation/logging/LogProvider.cs +++ b/src/System.Management.Automation/logging/LogProvider.cs @@ -228,7 +228,7 @@ protected static PSLevel GetPSLevelFromSeverity(string severity) // Estimated length of all Strings.* values // Rough estimate of values // max path for Command path - private const int LogContextInitialSize = 30 * 16 + 13 * 20 + 255; + private const int LogContextInitialSize = (30 * 16) + (13 * 20) + 255; /// /// Converts log context to string. diff --git a/src/System.Management.Automation/namespaces/LocationGlobber.cs b/src/System.Management.Automation/namespaces/LocationGlobber.cs index d5e60b652c9..68991d79821 100644 --- a/src/System.Management.Automation/namespaces/LocationGlobber.cs +++ b/src/System.Management.Automation/namespaces/LocationGlobber.cs @@ -3356,8 +3356,8 @@ private List GenerateNewPSPathsWithGlobLeaf( // Only loop through the child names if the leafElement contains a glob character - if (!string.IsNullOrEmpty(leafElement) && - StringContainsGlobCharacters(leafElement) || + if ((!string.IsNullOrEmpty(leafElement) && + StringContainsGlobCharacters(leafElement)) || isLastLeaf) { string regexEscapedLeafElement = ConvertMshEscapeToRegexEscape(leafElement); diff --git a/src/System.Management.Automation/security/SecureStringHelper.cs b/src/System.Management.Automation/security/SecureStringHelper.cs index e6180dc39b7..a1f5961889f 100644 --- a/src/System.Management.Automation/security/SecureStringHelper.cs +++ b/src/System.Management.Automation/security/SecureStringHelper.cs @@ -49,14 +49,14 @@ private static SecureString New(byte[] data) for (int i = 0; i < len; i++) { - ch = (char)(data[2 * i + 1] * 256 + data[2 * i]); + ch = (char)((data[(2 * i) + 1] * 256) + data[2 * i]); ss.AppendChar(ch); // // zero out the data slots as soon as we use them // data[2 * i] = 0; - data[2 * i + 1] = 0; + data[(2 * i) + 1] = 0; } return ss; diff --git a/src/System.Management.Automation/utils/PsUtils.cs b/src/System.Management.Automation/utils/PsUtils.cs index 5866e3d52f9..fa0f0ed93c4 100644 --- a/src/System.Management.Automation/utils/PsUtils.cs +++ b/src/System.Management.Automation/utils/PsUtils.cs @@ -599,7 +599,7 @@ private static uint Compute(byte[] buffer) uint crc = 0xFFFFFFFF; for (int i = 0; i < buffer.Length; ++i) { - var index = (byte)(crc ^ buffer[i] & 0xff); + var index = (byte)(crc ^ (buffer[i] & 0xff)); crc = (crc >> 8) ^ table[index]; } From a3f49eabd3ff01adcfc885b79deca479821a3c96 Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Sun, 1 Nov 2020 18:29:19 +0000 Subject: [PATCH 2/3] fixup! Enable IDE0048: AddRequiredParentheses --- .../engine/hostifaces/LocalConnection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs index 92740acf8dd..153d18c714d 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs @@ -987,7 +987,7 @@ private void StopOrDisconnectAllJobs() foreach (Job job in this.JobRepository.Jobs) { // Only stop or disconnect PowerShell jobs. - if (job is PSRemotingJob == false) + if ((job is PSRemotingJob) == false) { continue; } From c3dd43914bb5c3b19953946b2707b7079270ba01 Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Mon, 2 Nov 2020 10:54:03 +0000 Subject: [PATCH 3/3] Reduce severity to suggestion --- .globalconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.globalconfig b/.globalconfig index a3157cf2991..33d6fe31e7e 100644 --- a/.globalconfig +++ b/.globalconfig @@ -868,7 +868,7 @@ dotnet_diagnostic.IDE0046.severity = silent dotnet_diagnostic.IDE0047.severity = silent # IDE0048: AddRequiredParentheses -dotnet_diagnostic.IDE0048.severity = warning +dotnet_diagnostic.IDE0048.severity = suggestion # IDE0049: PreferBuiltInOrFrameworkType dotnet_diagnostic.IDE0049.severity = silent