DotNetAnalyzers / StyleCopAnalyzers

An implementation of StyleCop rules using the .NET Compiler Platform
MIT License
2.64k stars 507 forks source link

SA1600 fires for internal interfaces even if documentInternalElements is false #3888

Open ds1709 opened 2 weeks ago

ds1709 commented 2 weeks ago

As described, SA1600 fires warning for internal interfaces even if documentInternalElements option set to false. Works correct for classes. My stylecop.json

{
  "settings": {
    "orderingRules": { "usingDirectivesPlacement": "outsideNamespace" },
    "documentationRules": {
      "documentInternalElements": false,
      "documentationCulture": "ru-RU"
    }
  }
}
bjornhellander commented 2 weeks ago

This is by design, although not without problems. See https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/Configuration.md#documentation-requirements, specifically the description for documentInterfaces:

Specifies whether interface members need to be documented. When true, all interface members require documentation, regardless of accessibility.

Note that although it says "interface members", this also applies to interfaces themselves.

If you do not require documentation specifically for interfaces, then you can set documentInterfaces to false. That would mean that the remaining documentation settings would apply equally for interfaces and other types.

Duplicate of #2934. This also links to a request to make SA1600 etc more configurable.

ds1709 commented 1 week ago

Setting documentInterfaces to false solves the problem partialy. It not requires to document internal interfaces now, but it also not requires to document members of public interfaces, but requires to document interface itself. image