1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 16:12:54 +08:00

Merge pull request #28051 from frenzibyte/fix-naming-inspections

Handle new naming inspections on certain enums
This commit is contained in:
Dean Herbert 2024-05-02 09:33:39 +08:00 committed by GitHub
commit fb4a304ad1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 84 additions and 62 deletions

View File

@ -489,6 +489,7 @@ namespace osu.Desktop
public static uint Stride => (uint)Marshal.SizeOf(typeof(NvApplication)) | (2 << 16); public static uint Stride => (uint)Marshal.SizeOf(typeof(NvApplication)) | (2 << 16);
} }
[SuppressMessage("ReSharper", "InconsistentNaming")]
internal enum NvStatus internal enum NvStatus
{ {
OK = 0, // Success. Request is completed. OK = 0, // Success. Request is completed.
@ -611,6 +612,7 @@ namespace osu.Desktop
FIRMWARE_REVISION_NOT_SUPPORTED = -200, // The device's firmware is not supported. FIRMWARE_REVISION_NOT_SUPPORTED = -200, // The device's firmware is not supported.
} }
[SuppressMessage("ReSharper", "InconsistentNaming")]
internal enum NvSystemType internal enum NvSystemType
{ {
UNKNOWN = 0, UNKNOWN = 0,
@ -618,6 +620,7 @@ namespace osu.Desktop
DESKTOP = 2 DESKTOP = 2
} }
[SuppressMessage("ReSharper", "InconsistentNaming")]
internal enum NvGpuType internal enum NvGpuType
{ {
UNKNOWN = 0, UNKNOWN = 0,
@ -625,6 +628,7 @@ namespace osu.Desktop
DGPU = 2, // Discrete DGPU = 2, // Discrete
} }
[SuppressMessage("ReSharper", "InconsistentNaming")]
internal enum NvSettingID : uint internal enum NvSettingID : uint
{ {
OGL_AA_LINE_GAMMA_ID = 0x2089BF6C, OGL_AA_LINE_GAMMA_ID = 0x2089BF6C,
@ -717,6 +721,7 @@ namespace osu.Desktop
INVALID_SETTING_ID = 0xFFFFFFFF INVALID_SETTING_ID = 0xFFFFFFFF
} }
[SuppressMessage("ReSharper", "InconsistentNaming")]
internal enum NvShimSetting : uint internal enum NvShimSetting : uint
{ {
SHIM_RENDERING_MODE_INTEGRATED = 0x00000000, SHIM_RENDERING_MODE_INTEGRATED = 0x00000000,
@ -731,6 +736,7 @@ namespace osu.Desktop
SHIM_RENDERING_MODE_DEFAULT = SHIM_RENDERING_MODE_AUTO_SELECT SHIM_RENDERING_MODE_DEFAULT = SHIM_RENDERING_MODE_AUTO_SELECT
} }
[SuppressMessage("ReSharper", "InconsistentNaming")]
internal enum NvThreadControlSetting : uint internal enum NvThreadControlSetting : uint
{ {
OGL_THREAD_CONTROL_ENABLE = 0x00000001, OGL_THREAD_CONTROL_ENABLE = 0x00000001,

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Diagnostics.CodeAnalysis;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.Versioning; using System.Runtime.Versioning;
@ -163,6 +164,7 @@ namespace osu.Desktop.Windows
[DllImport("Shell32.dll")] [DllImport("Shell32.dll")]
private static extern void SHChangeNotify(EventId wEventId, Flags uFlags, IntPtr dwItem1, IntPtr dwItem2); private static extern void SHChangeNotify(EventId wEventId, Flags uFlags, IntPtr dwItem1, IntPtr dwItem2);
[SuppressMessage("ReSharper", "InconsistentNaming")]
private enum EventId private enum EventId
{ {
/// <summary> /// <summary>
@ -172,6 +174,7 @@ namespace osu.Desktop.Windows
SHCNE_ASSOCCHANGED = 0x08000000 SHCNE_ASSOCCHANGED = 0x08000000
} }
[SuppressMessage("ReSharper", "InconsistentNaming")]
private enum Flags : uint private enum Flags : uint
{ {
SHCNF_IDLIST = 0x0000 SHCNF_IDLIST = 0x0000

View File

@ -123,58 +123,58 @@ namespace osu.Game.IO.Legacy
switch (t) switch (t)
{ {
case ObjType.boolType: case ObjType.BoolType:
return ReadBoolean(); return ReadBoolean();
case ObjType.byteType: case ObjType.ByteType:
return ReadByte(); return ReadByte();
case ObjType.uint16Type: case ObjType.UInt16Type:
return ReadUInt16(); return ReadUInt16();
case ObjType.uint32Type: case ObjType.UInt32Type:
return ReadUInt32(); return ReadUInt32();
case ObjType.uint64Type: case ObjType.UInt64Type:
return ReadUInt64(); return ReadUInt64();
case ObjType.sbyteType: case ObjType.SByteType:
return ReadSByte(); return ReadSByte();
case ObjType.int16Type: case ObjType.Int16Type:
return ReadInt16(); return ReadInt16();
case ObjType.int32Type: case ObjType.Int32Type:
return ReadInt32(); return ReadInt32();
case ObjType.int64Type: case ObjType.Int64Type:
return ReadInt64(); return ReadInt64();
case ObjType.charType: case ObjType.CharType:
return ReadChar(); return ReadChar();
case ObjType.stringType: case ObjType.StringType:
return base.ReadString(); return base.ReadString();
case ObjType.singleType: case ObjType.SingleType:
return ReadSingle(); return ReadSingle();
case ObjType.doubleType: case ObjType.DoubleType:
return ReadDouble(); return ReadDouble();
case ObjType.decimalType: case ObjType.DecimalType:
return ReadDecimal(); return ReadDecimal();
case ObjType.dateTimeType: case ObjType.DateTimeType:
return ReadDateTime(); return ReadDateTime();
case ObjType.byteArrayType: case ObjType.ByteArrayType:
return ReadByteArray(); return ReadByteArray();
case ObjType.charArrayType: case ObjType.CharArrayType:
return ReadCharArray(); return ReadCharArray();
case ObjType.otherType: case ObjType.OtherType:
throw new IOException("Deserialization of arbitrary type is not supported."); throw new IOException("Deserialization of arbitrary type is not supported.");
default: default:
@ -185,25 +185,25 @@ namespace osu.Game.IO.Legacy
public enum ObjType : byte public enum ObjType : byte
{ {
nullType, NullType,
boolType, BoolType,
byteType, ByteType,
uint16Type, UInt16Type,
uint32Type, UInt32Type,
uint64Type, UInt64Type,
sbyteType, SByteType,
int16Type, Int16Type,
int32Type, Int32Type,
int64Type, Int64Type,
charType, CharType,
stringType, StringType,
singleType, SingleType,
doubleType, DoubleType,
decimalType, DecimalType,
dateTimeType, DateTimeType,
byteArrayType, ByteArrayType,
charArrayType, CharArrayType,
otherType, OtherType,
ILegacySerializableType LegacySerializableType
} }
} }

View File

@ -34,11 +34,11 @@ namespace osu.Game.IO.Legacy
{ {
if (str == null) if (str == null)
{ {
Write((byte)ObjType.nullType); Write((byte)ObjType.NullType);
} }
else else
{ {
Write((byte)ObjType.stringType); Write((byte)ObjType.StringType);
base.Write(str); base.Write(str);
} }
} }
@ -125,94 +125,94 @@ namespace osu.Game.IO.Legacy
{ {
if (obj == null) if (obj == null)
{ {
Write((byte)ObjType.nullType); Write((byte)ObjType.NullType);
} }
else else
{ {
switch (obj) switch (obj)
{ {
case bool boolObj: case bool boolObj:
Write((byte)ObjType.boolType); Write((byte)ObjType.BoolType);
Write(boolObj); Write(boolObj);
break; break;
case byte byteObj: case byte byteObj:
Write((byte)ObjType.byteType); Write((byte)ObjType.ByteType);
Write(byteObj); Write(byteObj);
break; break;
case ushort ushortObj: case ushort ushortObj:
Write((byte)ObjType.uint16Type); Write((byte)ObjType.UInt16Type);
Write(ushortObj); Write(ushortObj);
break; break;
case uint uintObj: case uint uintObj:
Write((byte)ObjType.uint32Type); Write((byte)ObjType.UInt32Type);
Write(uintObj); Write(uintObj);
break; break;
case ulong ulongObj: case ulong ulongObj:
Write((byte)ObjType.uint64Type); Write((byte)ObjType.UInt64Type);
Write(ulongObj); Write(ulongObj);
break; break;
case sbyte sbyteObj: case sbyte sbyteObj:
Write((byte)ObjType.sbyteType); Write((byte)ObjType.SByteType);
Write(sbyteObj); Write(sbyteObj);
break; break;
case short shortObj: case short shortObj:
Write((byte)ObjType.int16Type); Write((byte)ObjType.Int16Type);
Write(shortObj); Write(shortObj);
break; break;
case int intObj: case int intObj:
Write((byte)ObjType.int32Type); Write((byte)ObjType.Int32Type);
Write(intObj); Write(intObj);
break; break;
case long longObj: case long longObj:
Write((byte)ObjType.int64Type); Write((byte)ObjType.Int64Type);
Write(longObj); Write(longObj);
break; break;
case char charObj: case char charObj:
Write((byte)ObjType.charType); Write((byte)ObjType.CharType);
base.Write(charObj); base.Write(charObj);
break; break;
case string stringObj: case string stringObj:
Write((byte)ObjType.stringType); Write((byte)ObjType.StringType);
base.Write(stringObj); base.Write(stringObj);
break; break;
case float floatObj: case float floatObj:
Write((byte)ObjType.singleType); Write((byte)ObjType.SingleType);
Write(floatObj); Write(floatObj);
break; break;
case double doubleObj: case double doubleObj:
Write((byte)ObjType.doubleType); Write((byte)ObjType.DoubleType);
Write(doubleObj); Write(doubleObj);
break; break;
case decimal decimalObj: case decimal decimalObj:
Write((byte)ObjType.decimalType); Write((byte)ObjType.DecimalType);
Write(decimalObj); Write(decimalObj);
break; break;
case DateTime dateTimeObj: case DateTime dateTimeObj:
Write((byte)ObjType.dateTimeType); Write((byte)ObjType.DateTimeType);
Write(dateTimeObj); Write(dateTimeObj);
break; break;
case byte[] byteArray: case byte[] byteArray:
Write((byte)ObjType.byteArrayType); Write((byte)ObjType.ByteArrayType);
base.Write(byteArray); base.Write(byteArray);
break; break;
case char[] charArray: case char[] charArray:
Write((byte)ObjType.charArrayType); Write((byte)ObjType.CharArrayType);
base.Write(charArray); base.Write(charArray);
break; break;

View File

@ -2,10 +2,12 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using JetBrains.Annotations; using JetBrains.Annotations;
namespace osu.Game.Localisation namespace osu.Game.Localisation
{ {
[SuppressMessage("ReSharper", "InconsistentNaming")]
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] [UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
public enum Language public enum Language
{ {

View File

@ -35,6 +35,7 @@ namespace osu.Game.Scoring
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.RankSH))] [LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.RankSH))]
[Description(@"S+")] [Description(@"S+")]
// ReSharper disable once InconsistentNaming
SH, SH,
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.RankX))] [LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.RankX))]
@ -43,6 +44,7 @@ namespace osu.Game.Scoring
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.RankXH))] [LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.RankXH))]
[Description(@"SS+")] [Description(@"SS+")]
// ReSharper disable once InconsistentNaming
XH, XH,
} }
} }

View File

@ -486,16 +486,16 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
Off = 0, Off = 0,
[Description("30 seconds")] [Description("30 seconds")]
Seconds_30 = 30, Seconds30 = 30,
[Description("1 minute")] [Description("1 minute")]
Seconds_60 = 60, Seconds60 = 60,
[Description("3 minutes")] [Description("3 minutes")]
Seconds_180 = 180, Seconds180 = 180,
[Description("5 minutes")] [Description("5 minutes")]
Seconds_300 = 300 Seconds300 = 300
} }
} }
} }

View File

@ -67,7 +67,10 @@ namespace osu.Game.Skinning
LeftStageImage, LeftStageImage,
RightStageImage, RightStageImage,
BottomStageImage, BottomStageImage,
// ReSharper disable once InconsistentNaming
Hit300g, Hit300g,
Hit300, Hit300,
Hit200, Hit200,
Hit100, Hit100,

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using JetBrains.Annotations; using JetBrains.Annotations;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
@ -12,6 +13,7 @@ namespace osu.Game.Users
/// Matches `osu_countries` database table. /// Matches `osu_countries` database table.
/// </summary> /// </summary>
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(StringEnumConverter))]
[SuppressMessage("ReSharper", "InconsistentNaming")]
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] [UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
public enum CountryCode public enum CountryCode
{ {

View File

@ -340,6 +340,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=API/@EntryIndexedValue">API</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=API/@EntryIndexedValue">API</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ARGB/@EntryIndexedValue">ARGB</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ARGB/@EntryIndexedValue">ARGB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BPM/@EntryIndexedValue">BPM</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BPM/@EntryIndexedValue">BPM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DDKK/@EntryIndexedValue">DDKK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EF/@EntryIndexedValue">EF</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EF/@EntryIndexedValue">EF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FPS/@EntryIndexedValue">FPS</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FPS/@EntryIndexedValue">FPS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GC/@EntryIndexedValue">GC</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GC/@EntryIndexedValue">GC</s:String>
@ -357,6 +358,8 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IPC/@EntryIndexedValue">IPC</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IPC/@EntryIndexedValue">IPC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JIT/@EntryIndexedValue">JIT</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JIT/@EntryIndexedValue">JIT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KDDK/@EntryIndexedValue">KDDK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KKDD/@EntryIndexedValue">KKDD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LTRB/@EntryIndexedValue">LTRB</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LTRB/@EntryIndexedValue">LTRB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD5</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD5</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NS/@EntryIndexedValue">NS</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NS/@EntryIndexedValue">NS</s:String>
@ -375,6 +378,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QAT/@EntryIndexedValue">QAT</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QAT/@EntryIndexedValue">QAT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BNG/@EntryIndexedValue">BNG</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BNG/@EntryIndexedValue">BNG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WIP/@EntryIndexedValue">WIP</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue">False</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue">HINT</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&#xD; <s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&#xD;