The setting "ignore privates" "ignore internals" does not affect inner classes and their subelements

For some strange reason, StyleCop does not follow my documentation rules. 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> </AnalyzerSettings> </Analyzer> ... 

I get the following stylecop 4.4 form messages

  • SA1600: the class must have a documentation title.
  • SA1600: The constructor must have a documentation title.
  • SA1600: The method must have a documentation title.
  • SA1600: Property must have a title of documentation.

Is this a bug or function? Should inner classes be ignored?

+4
source share
1 answer

If you use Stylecop from Visual Studio, check if your settings are also checked in the StyleCop → Documentation Rules settings, otherwise you can overwrite your settings at runtime.

+1
source

Source: https://habr.com/ru/post/1335071/


All Articles