Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ds1709 opened this issue Sep 2, 2024 · 4 comments

Comments

@ds1709
Copy link

ds1709 commented Sep 2, 2024

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
Copy link
Contributor

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
Copy link
Author

ds1709 commented Sep 3, 2024

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

@mikernet
Copy link

mikernet commented Oct 12, 2024

I think that it makes a lot more sense to turn off this warning if documentInternalElements is false. The effective setting for internal interface members should be documentInterfaces && documentInternalElements, not documentInterfaces || documentInternalElements. The latter is clearly undesirable.

@mikernet
Copy link

mikernet commented Oct 12, 2024

It already doesn't warn on the internal interface member itself so it doesn't make sense to warn for class members that implement the interface explicitly.

The internal interface member itself is fine:

image

But classes that implement the internal interface member explicitly are warning:

image

@sharwell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants