如何使用 .editorconfig
更改
allStyleCop 规则的严重性?
配置单独的规则有效:
dotnet_diagnostic.SA1202.severity = error
但是,我正在寻找影响每条规则的全局变化。
如果您想要设置所有分析器的所有规则,请使用以下命令:
dotnet_analyzer_diagnostic.severity = error
如果您只想设置
Stylecop.Analyzers
包规则,请使用以下命令:
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.AlternativeRules.severity = error
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = error
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.LayoutRules.severity = error
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.MaintainabilityRules.severity = error
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.NamingRules.severity = error
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.OrderingRules.severity = error
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.ReadabilityRules.severity = error
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.SpacingRules.severity = error
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.SpecialRules.severity = error
然后可以单独覆盖各个规则,如下所示:
dotnet_diagnostic.SA1400.severity = warning