diff --git a/Terminal.Gui/Configuration/ConfigurationManager.cs b/Terminal.Gui/Configuration/ConfigurationManager.cs index e234b6ee7f..25826339a2 100644 --- a/Terminal.Gui/Configuration/ConfigurationManager.cs +++ b/Terminal.Gui/Configuration/ConfigurationManager.cs @@ -110,6 +110,7 @@ public enum ConfigLocations 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/View/Layout/Dim.cs b/Terminal.Gui/View/Layout/Dim.cs index 7a9b47ef83..83d169e2cf 100644 --- a/Terminal.Gui/View/Layout/Dim.cs +++ b/Terminal.Gui/View/Layout/Dim.cs @@ -49,7 +49,7 @@ namespace Terminal.Gui; /// /// /// -/// +/// /// /// /// 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 56391b8795..b5233a6dcb 100644 --- a/Terminal.Gui/View/Layout/Pos.cs +++ b/Terminal.Gui/View/Layout/Pos.cs @@ -333,7 +333,7 @@ public static Pos Percent (int percent) /// /// 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 19cef890b3..4ef00a5b77 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 b407d4fa18..99b339da32 100644 --- a/Terminal.Gui/View/View.Layout.cs +++ b/Terminal.Gui/View/View.Layout.cs @@ -451,7 +451,7 @@ public Pos Y /// . /// /// - /// 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 Dim? Height /// . /// /// - /// 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 00d6ee3f5d..9c5cec83be 100644 --- a/Terminal.Gui/Views/ColorPicker.cs +++ b/Terminal.Gui/Views/ColorPicker.cs @@ -154,7 +154,7 @@ private void CreateNameField () _tfName.Autocomplete = auto; _tfName.HasFocusChanged += UpdateValueFromName; - _tfName.Accept += (_s, _) => UpdateValueFromName (); + _tfName.Accept += (s, _) => UpdateValueFromName (); } private void CreateTextField () @@ -303,7 +303,7 @@ private void UpdateSingleBarValueFromTextField (object? sender) } } - 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 d4dc3e1cfd..a97bef4739 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 471e0984ad..3eed462edf 100644 --- a/UICatalog/UICatalog.cs +++ b/UICatalog/UICatalog.cs @@ -5,6 +5,7 @@ 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 UICatalogTopLevel () _diagnosticFlags = Diagnostics; _themeMenuItems = CreateThemeMenuItems (); - _themeMenuBarItem = new ("_Themes", _themeMenuItems); + _themeMenuBarItem = new ("_Themes", _themeMenuItems!); MenuBar menuBar = new () { @@ -676,7 +679,7 @@ public void ConfigChanged () 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 @@ private void CategoryView_SelectedChanged (object? sender, ListViewItemEventArgs 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 afa6c1b63b..8ee2a8202d 100644 --- a/UnitTests/FileServices/FileDialogTests.cs +++ b/UnitTests/FileServices/FileDialogTests.cs @@ -4,7 +4,7 @@ namespace Terminal.Gui.FileServicesTests; -public class FileDialogTests (ITestOutputHelper output) +public class FileDialogTests () { [Theory] [InlineData (true)] @@ -787,7 +787,6 @@ private TextField GetTextField (FileDialog dlg, FileDialogPart part) 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/Views/DateFieldTests.cs b/UnitTests/Views/DateFieldTests.cs index 7ba7e9e48c..3f17e89500 100644 --- a/UnitTests/Views/DateFieldTests.cs +++ b/UnitTests/Views/DateFieldTests.cs @@ -175,6 +175,12 @@ public void Typing_With_Selection_Normalize_Format () [Fact] public void Using_All_Culture_StandardizeDateFormat () { + // BUGBUG: This is a workaround for the issue with the date separator in macOS. See https://github.com/gui-cs/Terminal.Gui/issues/3592 + if (RuntimeInformation.IsOSPlatform (OSPlatform.OSX)) + { + return; + } + CultureInfo cultureBackup = CultureInfo.CurrentCulture; DateTime date = DateTime.Parse ("1/1/1971"); @@ -193,6 +199,7 @@ public void Using_All_Culture_StandardizeDateFormat () separator = " "; } + string format = culture.DateTimeFormat.ShortDatePattern; var df = new DateField (date);