开发者

setting "ignore privates" "ignore internals" has no effect for internal classes and their subelements

开发者 https://www.devze.com 2023-02-04 15:25 出处:网络
For some strange reason StyleCop does not respect my documentation rule settings. Consider the following code:

For some strange reason StyleCop does not respect my documentation rule settings. Consider the following code:

internal class SomeClass
{
    public SomeClass()
    {
    }

    public SomeMethod()
    {
    }

    public SomeProperty { get; set; }
}

And the following settings:

<Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.DocumentationRules">
...
    <AnalyzerSettings>
       <BooleanProperty Name="IgnorePrivates">True</BooleanProperty>
       <BooleanProperty Name="IgnoreInternals">True</BooleanProperty>
    </AnalyzerSetting开发者_C百科s>
</Analyzer>
...

I get the following messages form stylecop 4.4

  • SA1600: The class must have a documentation header.
  • SA1600: The constructor must have a documentation header.
  • SA1600: The method must have a documentation header.
  • SA1600: The property must have a documentation header.

Is this a bug or a feature? Shouldn't internal classes be ignored?


If you use Stylecop from within Visual Studio, check if your settings are also ticked under StyleCop Settings -> Documentation Rules, might otherwise overwrite your settings at runtime.

0

精彩评论

暂无评论...
验证码 换一张
取 消