Skip to content

Commit 364ca57

Browse files
committed
chore: update coding rules to .net9.0
1 parent 03197d0 commit 364ca57

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

.editorconfig

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
2-
# Version: 1.0.1
3-
# Updated: 03-06-2024
2+
# Version: 1.0.0
3+
# Updated: 01-03-2025
44
# Location: Root
5-
# Distribution: DotNet8
5+
# Distribution: DotNet9
66
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
77

88
##########################################
@@ -492,6 +492,8 @@ dotnet_diagnostic.CA1867.severity = suggestion # Use char overload
492492
dotnet_diagnostic.CA1868.severity = suggestion # Unnecessary call to 'Contains(item)'
493493
dotnet_diagnostic.CA1869.severity = suggestion # Cache and reuse 'JsonSerializerOptions' instances
494494
dotnet_diagnostic.CA1870.severity = suggestion # Use a cached 'SearchValues' instance
495+
dotnet_diagnostic.CA1871.severity = suggestion # Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull'
496+
dotnet_diagnostic.CA1872.severity = suggestion # Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString'
495497
dotnet_diagnostic.CA2007.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md
496498
dotnet_diagnostic.CA2017.severity = error # Parameter count mismatch
497499
dotnet_diagnostic.CA2018.severity = error # The count argument to Buffer.BlockCopy should specify the number of bytes to copy
@@ -505,6 +507,9 @@ dotnet_diagnostic.CA2255.severity = suggestion # The ModuleInitializer attr
505507
dotnet_diagnostic.CA2259.severity = error # Ensure ThreadStatic is only used with static fields
506508
dotnet_diagnostic.CA2260.severity = error # Implement generic math interfaces correctly
507509
dotnet_diagnostic.CA2261.severity = error # Do not use ConfigureAwaitOptions.SuppressThrowing with Task<TResult>
510+
dotnet_diagnostic.CA2262.severity = suggestion # Set 'MaxResponseHeadersLength' properly
511+
dotnet_diagnostic.CA2263.severity = suggestion # Prefer generic overload when type is known
512+
dotnet_diagnostic.CA2264.severity = error # Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'
508513
dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md
509514
dotnet_diagnostic.IDE0010.severity = suggestion # Populate switch
510515
dotnet_diagnostic.IDE0028.severity = suggestion # Collection initialization can be simplified
@@ -557,6 +562,7 @@ dotnet_diagnostic.S3358.severity = none # Extract this nested ternary
557562
dotnet_diagnostic.S6602.severity = none # "Find" method should be used instead of the "FirstOrDefault"
558563
dotnet_diagnostic.S6603.severity = none # The collection-specific "TrueForAll" method should be used instead of the "All"
559564
dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any"
565+
dotnet_diagnostic.S6964.severity = none # Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting.
560566

561567

562568
##########################################

atc-coding-rules-updater.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"projectTarget": "DotNet8",
2+
"projectTarget": "DotNet9",
33
"useLatestMinorNugetVersion": true,
44
"useTemporarySuppressions": false,
55
"temporarySuppressionAsExcel": false,

src/.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
22
# Version: 1.0.0
3-
# Updated: 25-09-2023
3+
# Updated: 03-06-2024
44
# Location: src
5-
# Distribution: DotNet8
5+
# Distribution: DotNet9
66
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
77

88
##########################################

test/.editorconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
22
# Version: 1.0.0
3-
# Updated: 25-09-2023
3+
# Updated: 09-01-2025
44
# Location: test
5-
# Distribution: DotNet8
5+
# Distribution: DotNet9
66
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
77

88
##########################################
@@ -24,6 +24,7 @@ dotnet_diagnostic.MA0004.severity = none # https://github.com/atc-net
2424
dotnet_diagnostic.MA0016.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md
2525
dotnet_diagnostic.MA0051.severity = none # Method Length
2626

27+
2728
# Microsoft - Code Analysis
2829
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
2930
dotnet_diagnostic.CA1068.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md

0 commit comments

Comments
 (0)