From 704771b31f98c9c764f3c91d5809d6740844382d Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Thu, 21 Apr 2022 23:38:30 +0800 Subject: [PATCH] Revert naming style change and supress in code --- .editorconfig | 18 ++++++++++++++++-- .../Graphics/Primitives/RectangleF.cs | 2 ++ .../Graphics/Primitives/RectangleI.cs | 2 ++ osu.Framework/Graphics/Primitives/Vector2I.cs | 2 ++ .../LocalisableStringEqualityComparer.cs | 2 ++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 998f6c6bb..071d81da9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -43,7 +43,7 @@ dotnet_naming_rule.local_function_camelcase.severity = warning dotnet_naming_rule.local_function_camelcase.symbols = local_function dotnet_naming_rule.local_function_camelcase.style = camelcase -#all_lower for private and local constants +#all_lower for private and local constants/static readonlys dotnet_naming_style.all_lower.capitalization = all_lower dotnet_naming_style.all_lower.word_separator = _ @@ -54,13 +54,20 @@ dotnet_naming_rule.private_const_all_lower.severity = warning dotnet_naming_rule.private_const_all_lower.symbols = private_constants dotnet_naming_rule.private_const_all_lower.style = all_lower +dotnet_naming_symbols.private_static_readonly.applicable_accessibilities = private +dotnet_naming_symbols.private_static_readonly.required_modifiers = static,readonly +dotnet_naming_symbols.private_static_readonly.applicable_kinds = field +dotnet_naming_rule.private_static_readonly_all_lower.severity = warning +dotnet_naming_rule.private_static_readonly_all_lower.symbols = private_static_readonly +dotnet_naming_rule.private_static_readonly_all_lower.style = all_lower + dotnet_naming_symbols.local_constants.applicable_kinds = local dotnet_naming_symbols.local_constants.required_modifiers = const dotnet_naming_rule.local_const_all_lower.severity = warning dotnet_naming_rule.local_const_all_lower.symbols = local_constants dotnet_naming_rule.local_const_all_lower.style = all_lower -#ALL_UPPER for non private constants +#ALL_UPPER for non private constants/static readonlys dotnet_naming_style.all_upper.capitalization = all_upper dotnet_naming_style.all_upper.word_separator = _ @@ -71,6 +78,13 @@ dotnet_naming_rule.public_const_all_upper.severity = warning dotnet_naming_rule.public_const_all_upper.symbols = public_constants dotnet_naming_rule.public_const_all_upper.style = all_upper +dotnet_naming_symbols.public_static_readonly.applicable_accessibilities = public,internal,protected,protected_internal,private_protected +dotnet_naming_symbols.public_static_readonly.required_modifiers = static,readonly +dotnet_naming_symbols.public_static_readonly.applicable_kinds = field +dotnet_naming_rule.public_static_readonly_all_upper.severity = warning +dotnet_naming_rule.public_static_readonly_all_upper.symbols = public_static_readonly +dotnet_naming_rule.public_static_readonly_all_upper.style = all_upper + #Roslyn formating options #Formatting - indentation options diff --git a/osu.Framework/Graphics/Primitives/RectangleF.cs b/osu.Framework/Graphics/Primitives/RectangleF.cs index 3724e5cc6..faff3cb7d 100644 --- a/osu.Framework/Graphics/Primitives/RectangleF.cs +++ b/osu.Framework/Graphics/Primitives/RectangleF.cs @@ -17,7 +17,9 @@ namespace osu.Framework.Graphics.Primitives { /// Represents an instance of the class with its members uninitialized. /// 1 +#pragma warning disable IDE1006 // Naming style public static readonly RectangleF Empty; +#pragma warning restore IDE1006 public float X; public float Y; diff --git a/osu.Framework/Graphics/Primitives/RectangleI.cs b/osu.Framework/Graphics/Primitives/RectangleI.cs index 642c15b78..5dedad9f6 100644 --- a/osu.Framework/Graphics/Primitives/RectangleI.cs +++ b/osu.Framework/Graphics/Primitives/RectangleI.cs @@ -17,7 +17,9 @@ namespace osu.Framework.Graphics.Primitives { /// Represents an instance of the class with its members uninitialized. /// 1 +#pragma warning disable IDE1006 // Naming style public static readonly RectangleI Empty; +#pragma warning restore IDE1006 public int X; public int Y; diff --git a/osu.Framework/Graphics/Primitives/Vector2I.cs b/osu.Framework/Graphics/Primitives/Vector2I.cs index d41b64ef8..a4e3b5a39 100644 --- a/osu.Framework/Graphics/Primitives/Vector2I.cs +++ b/osu.Framework/Graphics/Primitives/Vector2I.cs @@ -25,9 +25,11 @@ namespace osu.Framework.Graphics.Primitives Y = y; } +#pragma warning disable IDE1006 // Naming style public static readonly Vector2I Zero; public static readonly Vector2I One = new Vector2I(1); +#pragma warning restore IDE1006 public static implicit operator Vector2(Vector2I r) => new Vector2(r.X, r.Y); diff --git a/osu.Framework/Localisation/LocalisableStringEqualityComparer.cs b/osu.Framework/Localisation/LocalisableStringEqualityComparer.cs index 2a0d06d3a..9b44713f0 100644 --- a/osu.Framework/Localisation/LocalisableStringEqualityComparer.cs +++ b/osu.Framework/Localisation/LocalisableStringEqualityComparer.cs @@ -12,7 +12,9 @@ namespace osu.Framework.Localisation public class LocalisableStringEqualityComparer : IEqualityComparer { // ReSharper disable once InconsistentNaming (follows EqualityComparer.Default) +#pragma warning disable IDE1006 // Naming style public static readonly LocalisableStringEqualityComparer Default = new LocalisableStringEqualityComparer(); +#pragma warning restore IDE1006 public bool Equals(LocalisableString x, LocalisableString y) {