我已经咨询过configuration documentation了,但是什么也找不到。
我想禁用以下两条规则:
SA1633: The file header is missing or not located at the top of the file.
SA1652: Enable XML documentation output.我的stylecop.json看起来像这样:
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"orderingRules": {
"usingDirectivesPlacement": "outsideNamespace"
}
}
}有什么想法吗?
发布于 2016-03-07 21:39:43
启用和禁用规则是通过规则集文件完成的,而不是配置.json文件。有关使用规则集文件的详细信息,请参阅https://msdn.microsoft.com/en-us/library/dd264996.aspx。
发布于 2017-09-14 07:33:29
另一种方法是在GlobalSuppressions.cs中指定抑制属性,如下所示:
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1633:File must have header", Justification = "<Pending>")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1652:Enable XML documentation output", Justification = "<Pending>")]https://stackoverflow.com/questions/35837242
复制相似问题