diff --git a/Terminal.Gui/Configuration/ConfigurationManager.cs b/Terminal.Gui/Configuration/ConfigurationManager.cs index e234b6ee7..25826339a 100644 --- a/Terminal.Gui/Configuration/ConfigurationManager.cs +++ b/Terminal.Gui/Configuration/ConfigurationManager.cs @@ -110,6 +110,7 @@ public static class ConfigurationManager TypeInfoResolver = SourceGenerationContext.Default }; + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] internal static readonly SourceGenerationContext _serializerContext = new (_serializerOptions); [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] diff --git a/Terminal.Gui/Terminal.Gui.csproj b/Terminal.Gui/Terminal.Gui.csproj index 4feaf3ae5..2ff2b0e99 100644 --- a/Terminal.Gui/Terminal.Gui.csproj +++ b/Terminal.Gui/Terminal.Gui.csproj @@ -141,4 +141,4 @@ true Miguel de Icaza, Tig Kindel (@tig), @BDisp - \ No newline at end of file + diff --git a/Terminal.Gui/View/Layout/Dim.cs b/Terminal.Gui/View/Layout/Dim.cs index 7a9b47ef8..83d169e2c 100644 --- a/Terminal.Gui/View/Layout/Dim.cs +++ b/Terminal.Gui/View/Layout/Dim.cs @@ -49,7 +49,7 @@ using System.Numerics; /// /// /// -/// +/// /// /// /// Creates a object that fills the dimension from the View's X position diff --git a/Terminal.Gui/View/Layout/Pos.cs b/Terminal.Gui/View/Layout/Pos.cs index 56391b879..b5233a6dc 100644 --- a/Terminal.Gui/View/Layout/Pos.cs +++ b/Terminal.Gui/View/Layout/Pos.cs @@ -333,7 +333,7 @@ public abstract record Pos /// /// Indicates whether the specified type is in the hierarchy of this Pos object. /// - /// A reference to this instance. + /// A reference to this instance. /// public bool Has (out Pos pos) where T : Pos { diff --git a/Terminal.Gui/View/View.Hierarchy.cs b/Terminal.Gui/View/View.Hierarchy.cs index 19cef890b..4ef00a5b7 100644 --- a/Terminal.Gui/View/View.Hierarchy.cs +++ b/Terminal.Gui/View/View.Hierarchy.cs @@ -1,10 +1,12 @@ #nullable enable using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; namespace Terminal.Gui; public partial class View // SuperView/SubView hierarchy management (SuperView, SubViews, Add, Remove, etc.) { + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] private static readonly IList _empty = new List (0).AsReadOnly (); private List? _subviews; // This is null, and allocated on demand. diff --git a/Terminal.Gui/View/View.Layout.cs b/Terminal.Gui/View/View.Layout.cs index b407d4fa1..99b339da3 100644 --- a/Terminal.Gui/View/View.Layout.cs +++ b/Terminal.Gui/View/View.Layout.cs @@ -451,7 +451,7 @@ public partial class View // Layout APIs /// . /// /// - /// If set to a relative value (e.g. ) the value is indeterminate until the view has + /// If set to a relative value (e.g. ) the value is indeterminate until the view has /// been initialized ( is true) and has been /// called. /// @@ -500,7 +500,7 @@ public partial class View // Layout APIs /// . /// /// - /// If set to a relative value (e.g. ) the value is indeterminate until the view has + /// If set to a relative value (e.g. ) the value is indeterminate until the view has /// been initialized ( is true) and has been /// called. /// diff --git a/Terminal.Gui/Views/ColorPicker.cs b/Terminal.Gui/Views/ColorPicker.cs index 00d6ee3f5..9c5cec83b 100644 --- a/Terminal.Gui/Views/ColorPicker.cs +++ b/Terminal.Gui/Views/ColorPicker.cs @@ -154,7 +154,7 @@ public class ColorPicker : View _tfName.Autocomplete = auto; _tfName.HasFocusChanged += UpdateValueFromName; - _tfName.Accept += (_s, _) => UpdateValueFromName (); + _tfName.Accept += (s, _) => UpdateValueFromName (); } private void CreateTextField () @@ -303,7 +303,7 @@ public class ColorPicker : View } } - private void UpdateValueFromName (object sender, HasFocusEventArgs e) + private void UpdateValueFromName (object? sender, HasFocusEventArgs e) { // if the new value of Focused is true then it is an enter event so ignore if (e.NewValue) diff --git a/Terminal.Gui/Views/Toplevel.cs b/Terminal.Gui/Views/Toplevel.cs index d4dc3e1cf..a97bef473 100644 --- a/Terminal.Gui/Views/Toplevel.cs +++ b/Terminal.Gui/Views/Toplevel.cs @@ -24,7 +24,7 @@ public partial class Toplevel : View /// /// Initializes a new instance of the class, /// defaulting to full screen. The and properties will be set to the - /// dimensions of the terminal using . + /// dimensions of the terminal using . /// public Toplevel () { diff --git a/UICatalog/UICatalog.cs b/UICatalog/UICatalog.cs index 471e0984a..3eed462ed 100644 --- a/UICatalog/UICatalog.cs +++ b/UICatalog/UICatalog.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.CommandLine; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; @@ -55,9 +56,11 @@ public class UICatalogApp private static int _cachedScenarioIndex; private static string? _cachedTheme = string.Empty; private static ObservableCollection? _categories; + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] private static readonly FileSystemWatcher _currentDirWatcher = new (); private static ViewDiagnosticFlags _diagnosticFlags; private static string _forceDriver = string.Empty; + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] private static readonly FileSystemWatcher _homeDirWatcher = new (); private static bool _isFirstRunning = true; private static Options _options; @@ -406,7 +409,7 @@ public class UICatalogApp _diagnosticFlags = Diagnostics; _themeMenuItems = CreateThemeMenuItems (); - _themeMenuBarItem = new ("_Themes", _themeMenuItems); + _themeMenuBarItem = new ("_Themes", _themeMenuItems!); MenuBar menuBar = new () { @@ -676,7 +679,7 @@ public class UICatalogApp ColorScheme = Colors.ColorSchemes [_topLevelColorScheme]; - MenuBar!.Menus [0].Children [0].ShortcutKey = Application.QuitKey; + MenuBar!.Menus [0].Children! [0]!.ShortcutKey = Application.QuitKey; if (StatusBar is { }) { @@ -783,6 +786,7 @@ public class UICatalogApp private void ConfigAppliedHandler (object? sender, ConfigurationManagerEventArgs? a) { ConfigChanged (); } + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] private MenuItem [] CreateDiagnosticFlagsMenuItems () { const string OFF = "View Diagnostics: _Off"; diff --git a/UnitTests/FileServices/FileDialogTests.cs b/UnitTests/FileServices/FileDialogTests.cs index afa6c1b63..8ee2a8202 100644 --- a/UnitTests/FileServices/FileDialogTests.cs +++ b/UnitTests/FileServices/FileDialogTests.cs @@ -4,7 +4,7 @@ using Xunit.Abstractions; namespace Terminal.Gui.FileServicesTests; -public class FileDialogTests (ITestOutputHelper output) +public class FileDialogTests () { [Theory] [InlineData (true)] @@ -787,7 +787,6 @@ public class FileDialogTests (ITestOutputHelper output) return dlg.Subviews.OfType ().ElementAt (0); case FileDialogPart.SearchField: return dlg.Subviews.OfType ().ElementAt (1); - break; default: throw new ArgumentOutOfRangeException (nameof (part), part, null); } diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index 2db4a4017..c574ea37c 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -81,4 +81,4 @@ False - \ No newline at end of file + diff --git a/UnitTests/View/Layout/Dim.Tests.cs b/UnitTests/View/Layout/Dim.Tests.cs index 2ea62f244..a559e3361 100644 --- a/UnitTests/View/Layout/Dim.Tests.cs +++ b/UnitTests/View/Layout/Dim.Tests.cs @@ -342,7 +342,7 @@ public class DimTests #if DEBUG Assert.Equal ("Combine(Fill(Absolute(0))-Absolute(2))", v2.Height.ToString ()); #else - Assert.Equal ("Combine(Fill(0)-Absolute(2))", v2.Height.ToString ()); + Assert.Equal ("Combine(Fill(Absolute(0))-Absolute(2))", v2.Height.ToString ()); #endif Assert.Equal (47, v2.Frame.Width); // 49-2=47 Assert.Equal (89, v2.Frame.Height); // 98-5-2-2=89