Skip to content

Commit 8002e23

Browse files
author
Per Kops
committed
feat: add additional coding-rules to dotnet8 and dotnet9
1 parent b3a246a commit 8002e23

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

distribution/dotnet8/.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ dotnet_diagnostic.CA1511.severity = suggestion # Use ArgumentException thro
470470
dotnet_diagnostic.CA1512.severity = suggestion # Use ArgumentOutOfRangeException throw helper
471471
dotnet_diagnostic.CA1513.severity = suggestion # Use ObjectDisposedException throw helper
472472
dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument
473+
dotnet_diagnostic.CA1515.severity = suggestion # Because an application's API isn't typically referenced from outside the assembly, types can be made internal (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1515)
473474
dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
474475
dotnet_diagnostic.CA1812.severity = none
475476
dotnet_diagnostic.CA1822.severity = suggestion
@@ -505,7 +506,16 @@ dotnet_diagnostic.CA2259.severity = error # Ensure ThreadStatic is onl
505506
dotnet_diagnostic.CA2260.severity = error # Implement generic math interfaces correctly
506507
dotnet_diagnostic.CA2261.severity = error # Do not use ConfigureAwaitOptions.SuppressThrowing with Task<TResult>
507508
dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md
509+
dotnet_diagnostic.IDE0010.severity = suggestion # Populate switch
510+
dotnet_diagnostic.IDE0028.severity = suggestion # Collection initialization can be simplified
511+
dotnet_diagnostic.IDE0021.severity = suggestion # Use expression body for constructor
512+
dotnet_diagnostic.IDE0055.severity = none # Fix formatting
508513
dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md
514+
dotnet_diagnostic.IDE0061.severity = suggestion # Use expression body for local function
515+
dotnet_diagnostic.IDE0130.severity = suggestion # Namespace does not match folder structure
516+
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
517+
dotnet_diagnostic.IDE0301.severity = suggestion # Use collection expression for empty
518+
dotnet_diagnostic.IDE0305.severity = suggestion # Collection initialization can be simplified
509519

510520

511521
# Microsoft - Compiler Errors
@@ -542,6 +552,7 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net
542552
# https://rules.sonarsource.com/csharp
543553
dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md
544554
dotnet_diagnostic.S2629.severity = none # Don't use string interpolation in logging message templates.
555+
dotnet_diagnostic.S3358.severity = none # Extract this nested ternary operation into an independent statement.
545556
dotnet_diagnostic.S6602.severity = none # "Find" method should be used instead of the "FirstOrDefault"
546557
dotnet_diagnostic.S6603.severity = none # The collection-specific "TrueForAll" method should be used instead of the "All"
547558
dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any"

distribution/dotnet9/.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ dotnet_diagnostic.CA1511.severity = suggestion # Use ArgumentException thro
470470
dotnet_diagnostic.CA1512.severity = suggestion # Use ArgumentOutOfRangeException throw helper
471471
dotnet_diagnostic.CA1513.severity = suggestion # Use ObjectDisposedException throw helper
472472
dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument
473+
dotnet_diagnostic.CA1515.severity = suggestion # Because an application's API isn't typically referenced from outside the assembly, types can be made internal (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1515)
473474
dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
474475
dotnet_diagnostic.CA1812.severity = none
475476
dotnet_diagnostic.CA1822.severity = suggestion
@@ -510,7 +511,16 @@ dotnet_diagnostic.CA2262.severity = suggestion # Set 'MaxResponseHeadersLen
510511
dotnet_diagnostic.CA2263.severity = suggestion # Prefer generic overload when type is known
511512
dotnet_diagnostic.CA2264.severity = error # Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'
512513
dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md
514+
dotnet_diagnostic.IDE0010.severity = suggestion # Populate switch
515+
dotnet_diagnostic.IDE0028.severity = suggestion # Collection initialization can be simplified
516+
dotnet_diagnostic.IDE0021.severity = suggestion # Use expression body for constructor
517+
dotnet_diagnostic.IDE0055.severity = none # Fix formatting
513518
dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md
519+
dotnet_diagnostic.IDE0061.severity = suggestion # Use expression body for local function
520+
dotnet_diagnostic.IDE0130.severity = suggestion # Namespace does not match folder structure
521+
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
522+
dotnet_diagnostic.IDE0301.severity = suggestion # Use collection expression for empty
523+
dotnet_diagnostic.IDE0305.severity = suggestion # Collection initialization can be simplified
514524

515525

516526
# Microsoft - Compiler Errors
@@ -547,6 +557,7 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net
547557
# https://rules.sonarsource.com/csharp
548558
dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md
549559
dotnet_diagnostic.S2629.severity = none # Don't use string interpolation in logging message templates.
560+
dotnet_diagnostic.S3358.severity = none # Extract this nested ternary operation into an independent statement.
550561
dotnet_diagnostic.S6602.severity = none # "Find" method should be used instead of the "FirstOrDefault"
551562
dotnet_diagnostic.S6603.severity = none # The collection-specific "TrueForAll" method should be used instead of the "All"
552563
dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any"

0 commit comments

Comments
 (0)