Skip to content

Commit 2658030

Browse files
author
Per Kops
committed
chore: update coding-rules, static code analyzers and test nuget packages
1 parent eaa043a commit 2658030

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.editorconfig

Lines changed: 12 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"
@@ -560,6 +571,7 @@ dotnet_diagnostic.S6605.severity = none # Collection-specific "Exist
560571
dotnet_diagnostic.SA1615.severity = none # Element return value should be documented
561572

562573
dotnet_diagnostic.CA1056.severity = none # URI properties should not be strings
574+
dotnet_diagnostic.CA1515.severity = none # 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)
563575
dotnet_diagnostic.CA2007.severity = none # Consider calling ConfigureAwait on the awaited task
564576
dotnet_diagnostic.CA2227.severity = none # Collection properties should be read only
565577

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<ItemGroup Label="Code Analyzers">
5252
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
5353
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
54-
<PackageReference Include="Meziantou.Analyzer" Version="2.0.169" PrivateAssets="All" />
54+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.182" PrivateAssets="All" />
5555
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
5656
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="All" />
5757
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" PrivateAssets="All" />

test/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Atc.Test" Version="1.1.2" />
14+
<PackageReference Include="Atc.Test" Version="1.1.4" />
1515
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" PrivateAssets="All" />
1616
<PackageReference Include="coverlet.collector" Version="6.0.2">
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
<PrivateAssets>all</PrivateAssets>
1919
</PackageReference>
20-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
20+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
2121
<PackageReference Include="xunit" Version="2.9.2" />
2222
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
2323
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)