如何使用抑制来应用自定义规则?
[SuppressMessage("Your.Analyzer.Namespace", "AA1000:RuleName")]
StyleCop.SourceAnalyzer
的类),而不仅仅是命名空间,并且该完全限定名称与VisualStudio在警告列表中显示的不同(它显示为MyCustomRules.Custom
,但分析器类的完全限定名称为MyCustomRules.CustomRules
)。 - Suzanne Soy#region Stylecop will ignore regions with "generated code" in title, like this.
//...code you don't want style cope to test code goes here
#endregion