是否可以重新启用文件内的stylecop抑制?

时间:2017-06-23 01:43:18

标签: c# stylecop

我有一个源文件,其中一个小问题区域需要StyleCop抑制规则。我把抑制放在问题区域上方的源文件中。我想为文件的其余部分重新启用规则。有没有办法做到这一点? 例如:

[module: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SAXXXX: SomeStyleCopRule", Justification = "Reviewed. Suppression is OK here.")]
namespace MyNameSpace
{
    public class MyClass
    {
        public MyClass()
        {
            // ...some code which erroneously triggers StyleCop warning unless suppressed above...
        }
    }
    // Re-enable StyleCop warning here?
}

0 个答案:

没有答案