如何配置SonarAnalyzer.CSharp S1451使用.editorconfig时跟踪缺少版权和许可证标头的情况

问题描述

我没有使用SonarQube本地服务器,SonarCloud或SonarLint。相反,我只是直接在每个.NET Core项目中引用SonarAnalyzer.CSharp nuget包,然后使用.editorconfig(more info

配置规则严重性。

如何通过此设置配置许可证标题格式?通过将严重性设置为“错误”,分析仪可以看到默认的SQ许可证标头。

解决方法

SonarAnalyzer.CSharp当前不支持在.editorconfig文件中设置自定义规则参数。

您需要以正确的格式创建单独的SonarLint.xml文件,并将其引用为AdditionalFile。 有关更多信息,请参见this answer

,

检查 StyleCopAnalyzers 以在使用 .editorconfig 时添加版权和许可标头

dotnet_diagnostic.SA1633.severity=warning

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...