🔧 Migrates code analysis configuration to .globalconfig as per current recommendations

This commit is contained in:
2026-03-02 15:49:01 +02:00
parent a0eb6a7579
commit 08d94e2221
4 changed files with 17 additions and 30 deletions

View File

@@ -1,8 +1,24 @@
is_global = true
# Ruleset replacement
dotnet_diagnostic.CA2007.severity = none # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2007
# C# compiler diagnostics
dotnet_diagnostic.CS1573.severity = none # Missing XML comment for parameter
dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS2008.severity = none # No source files specified
# Code quality analyzers
dotnet_diagnostic.CA1303.severity = none # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1303
dotnet_diagnostic.CA1707.severity = none # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1707
dotnet_diagnostic.CA1848.severity = none # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1848
dotnet_diagnostic.CA2007.severity = none # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2007
# Serilog analyzers
dotnet_diagnostic.Serilog004.severity = none # Serilog context property accessor
# StyleCop analyzers
dotnet_diagnostic.SA1101.severity = none # Prefix local calls with this
dotnet_diagnostic.SA1633.severity = none # File must have header
dotnet_diagnostic.SA1649.severity = none # File name must match first type name
# Organize usings
dotnet_sort_system_directives_first = true

View File

@@ -139,12 +139,6 @@
</AssemblyAttribute>
</ItemGroup>
<!-- Use .NET ruleset for analyzers -->
<PropertyGroup Label="Code Analysis Ruleset"
Condition="Exists('$(MSBuildThisFileDirectory)\dotnet.ruleset')">
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)\dotnet.ruleset</CodeAnalysisRuleset>
</PropertyGroup>
<!-- Use readme as nuget information -->
<ItemGroup Label="Readme" Condition="$(IsPackable) == 'True' AND $(ProjectReadMeExists) == 'True'">
<Content Include="$(ProjectReadMe)" PackagePath="README.md" />

View File

@@ -12,7 +12,6 @@
<File Path="Directory.Build.props" />
<File Path="Directory.Build.targets" />
<File Path="Directory.Packages.props" />
<File Path="dotnet.ruleset" />
<File Path="GitVersion.yml" />
<File Path="stylecop.json" />
<File Path="xunit.runner.json" />

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Kritikos Ruleset" Description="Common roslyn analyser configuration" ToolsVersion="10.0">
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
<Rule Id="CS1573" Action="None" />
<Rule Id="CS1591" Action="None" />
<Rule Id="CS2008" Action="None" />
</Rules>
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
<Rule Id="CA1303" Action="None" />
<Rule Id="CA1848" Action="None" />
<Rule Id="CA2007" Action="None" />
<Rule Id="CA1707" Action="None" />
</Rules>
<Rules AnalyzerId="SerilogAnalyzer" RuleNamespace="SerilogAnalyzer">
<Rule Id="Serilog004" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1633" Action="None" />
<Rule Id="SA1649" Action="None" />
</Rules>
</RuleSet>