diff --git a/.editorconfig b/.editorconfig index 3c8f65b..e270271 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,6 +13,11 @@ ; This is the default for the codeline. root = true +; For disabling MA0048 and MA0051 in a specific folder, e.g., Migrations +[**/Migrations/*.cs] +dotnet_diagnostic.MA0048.severity = none +dotnet_diagnostic.MA0051.severity = none + [*] indent_style = space charset = utf-8 @@ -57,16 +62,16 @@ csharp_prefer_braces = true # Prefer curly braces even for one line of code # name all constant fields using PascalCase dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields -dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style -dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_symbols.constant_fields.applicable_kinds = field dotnet_naming_symbols.constant_fields.required_modifiers = const dotnet_naming_style.pascal_case_style.capitalization = pascal_case # internal and private fields should be _camelCase dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion -dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields -dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style dotnet_naming_symbols.private_internal_fields.applicable_kinds = field dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal dotnet_naming_style.camel_case_underscore_style.required_prefix = _ @@ -294,7 +299,7 @@ dotnet_diagnostic.IDE0031.severity = warning dotnet_diagnostic.IDE0035.severity = warning # IDE0036: Order modifiers -csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion +csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:suggestion dotnet_diagnostic.IDE0036.severity = warning # IDE0038: Use pattern matching to avoid is check followed by a cast (without variable) diff --git a/Benchmarks/Benchmarks.csproj b/Benchmarks/Benchmarks.csproj index 4546361..8b71371 100644 --- a/Benchmarks/Benchmarks.csproj +++ b/Benchmarks/Benchmarks.csproj @@ -10,6 +10,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Server/Server.csproj b/Server/Server.csproj index 1124056..de1dc56 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -9,6 +9,7 @@ default true net8.0;net7.0 + strict @@ -18,16 +19,16 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - @@ -36,6 +37,14 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -58,10 +67,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Wonderking/Packets/Incoming/ChannelSelectionPacket.cs b/Wonderking/Packets/Incoming/ChannelSelectionPacket.cs index d5db962..c74e385 100644 --- a/Wonderking/Packets/Incoming/ChannelSelectionPacket.cs +++ b/Wonderking/Packets/Incoming/ChannelSelectionPacket.cs @@ -12,5 +12,5 @@ public class ChannelSelectionPacket : IPacket this.ChannelId = BitConverter.ToUInt16(data, 2); } - public byte[] Serialize() => throw new NotImplementedException(); + public byte[] Serialize() => throw new NotSupportedException(); } diff --git a/Wonderking/Packets/Outgoing/ServerChannelData.cs b/Wonderking/Packets/Outgoing/ServerChannelData.cs index a2800ed..b707c4a 100644 --- a/Wonderking/Packets/Outgoing/ServerChannelData.cs +++ b/Wonderking/Packets/Outgoing/ServerChannelData.cs @@ -1,5 +1,8 @@ +using System.Runtime.InteropServices; + namespace Wonderking.Packets.Outgoing; +[StructLayout(LayoutKind.Auto)] public struct ServerChannelData { public ushort ServerId { get; set; } diff --git a/Wonderking/Wonderking.csproj b/Wonderking/Wonderking.csproj index a2cdaa6..c22f69e 100644 --- a/Wonderking/Wonderking.csproj +++ b/Wonderking/Wonderking.csproj @@ -4,10 +4,27 @@ enable enable net8.0;net7.0 + strict + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive +