From c0b676647b495b58e7d12693eb70d9ccd8066c5c Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Wed, 3 Jul 2024 21:08:19 +1000 Subject: [PATCH] Enable MA0104 and silence remaining cases "Do not create a type with a name from the BCL" --- .global.editorconfig.ini | 2 +- src/BizHawk.Client.Common/inputAdapters/InputManager.cs | 2 ++ src/BizHawk.Client.EmuHawk/CustomControls/RepeatButton.cs | 2 ++ src/BizHawk.Common/Colors.cs | 2 ++ src/BizHawk.Common/Extensions/CollectionExtensions.cs | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.global.editorconfig.ini b/.global.editorconfig.ini index 9194bc65b0..4fdd6a1173 100644 --- a/.global.editorconfig.ini +++ b/.global.editorconfig.ini @@ -307,7 +307,7 @@ dotnet_diagnostic.MA0102.severity = silent # Use SequenceEqual instead of equality operator dotnet_diagnostic.MA0103.severity = error # Do not create a type with a name from the BCL -dotnet_diagnostic.MA0104.severity = silent +dotnet_diagnostic.MA0104.severity = error # Use the lambda parameters instead of using a closure dotnet_diagnostic.MA0105.severity = error # Avoid closure by using an overload with the 'factoryArgument' parameter diff --git a/src/BizHawk.Client.Common/inputAdapters/InputManager.cs b/src/BizHawk.Client.Common/inputAdapters/InputManager.cs index edf2174518..7a9b659081 100644 --- a/src/BizHawk.Client.Common/inputAdapters/InputManager.cs +++ b/src/BizHawk.Client.Common/inputAdapters/InputManager.cs @@ -11,7 +11,9 @@ namespace BizHawk.Client.Common // user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> .. // .. -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game // (1)->Input Display +#pragma warning disable MA0104 // unlikely to conflict with System.Windows.Input.InputManager public class InputManager +#pragma warning restore MA0104 { // the original source controller, bound to the user, sort of the "input" port for the chain, i think public Controller ActiveController { get; private set; } diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/RepeatButton.cs b/src/BizHawk.Client.EmuHawk/CustomControls/RepeatButton.cs index 45e6d84f6e..93c71c7ff4 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/RepeatButton.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/RepeatButton.cs @@ -4,7 +4,9 @@ using System.Windows.Forms; namespace BizHawk.Client.EmuHawk { // http://www.codeproject.com/Articles/2130/NET-port-of-Joe-s-AutoRepeat-Button-class +#pragma warning disable MA0104 // unlikely to conflict with System.Windows.Controls.Primitives.RepeatButton public class RepeatButton : Button +#pragma warning restore MA0104 { private readonly Timer _mTimer; private bool _down; diff --git a/src/BizHawk.Common/Colors.cs b/src/BizHawk.Common/Colors.cs index 1d6802561b..a770e3e334 100644 --- a/src/BizHawk.Common/Colors.cs +++ b/src/BizHawk.Common/Colors.cs @@ -1,6 +1,8 @@ namespace BizHawk.Common { +#pragma warning disable MA0104 // unlikely to conflict with System.Windows.Media.Colors public static class Colors +#pragma warning restore MA0104 { /// This is just Color.FromArgb(alpha, red, green, blue).ToArgb() with extra steps. public static int ARGB(byte red, byte green, byte blue, byte alpha = 0xFF) => unchecked((int) ((uint) (alpha << 24) | (uint) (red << 16) | (uint) (green << 8) | blue)); diff --git a/src/BizHawk.Common/Extensions/CollectionExtensions.cs b/src/BizHawk.Common/Extensions/CollectionExtensions.cs index 3386869c95..807c237f01 100644 --- a/src/BizHawk.Common/Extensions/CollectionExtensions.cs +++ b/src/BizHawk.Common/Extensions/CollectionExtensions.cs @@ -7,7 +7,9 @@ using System.Runtime.CompilerServices; namespace BizHawk.Common.CollectionExtensions { +#pragma warning disable MA0104 // unlikely to conflict with System.Collections.Generic.CollectionExtensions public static class CollectionExtensions +#pragma warning restore MA0104 { public static IOrderedEnumerable OrderBy( this IEnumerable source,