From 3259737774d4d585eaad00f9795300d3ac77a627 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Wed, 15 Nov 2023 19:24:59 +0000 Subject: [PATCH] Add new .NET 8 rules to editorconfig. Don't enforce the rules yet, since we are still targeting .NET 6. --- .editorconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.editorconfig b/.editorconfig index 02295b6d10..3b441db9e1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -70,6 +70,10 @@ csharp_style_prefer_top_level_statements = false dotnet_diagnostic.IDE0210.severity = warning dotnet_diagnostic.IDE0211.severity = warning +# IDE0290 Use primary constructor +#csharp_style_prefer_primary_constructors = true +dotnet_diagnostic.IDE0200.severity = silent # Requires C# 12 + ## Expression-bodied members # IDE0021 Use expression body for constructors @@ -721,6 +725,9 @@ dotnet_diagnostic.CA1417.severity = warning # Use 'nameof' in place of string. dotnet_diagnostic.CA1507.severity = warning +# Avoid redundant length argument. +dotnet_diagnostic.CA1514.severity = suggestion # TODO: Change to warning once using .NET 8 or later. + ### Naming Rules ### https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/naming-warnings @@ -851,6 +858,12 @@ dotnet_diagnostic.CA1858.severity = warning # Avoid using 'Enumerable.Any()' extension method. dotnet_diagnostic.CA1860.severity = warning +# Cache and reuse 'JsonSerializerOptions' instances. +dotnet_diagnostic.CA1869.severity = suggestion # TODO: Change to warning once using .NET 8 or later. + +# Use a cached 'SearchValues' instance. +dotnet_diagnostic.CA1870.severity = suggestion # TODO: Change to warning once using .NET 8 or later. + ### Reliability Rules ### https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/reliability-warnings