I would like to enforce the usage of XML documentation on interface members in C# projects.
I'm looking for the same kind of behavior as SA1600 or CS1591 but limited to interfaces instead of all types.
How can I achieve this?
Copyright © 2021 Jogjafile Inc.
You can use a custom DiagnosticSuppressor similar to this :
A few things that you could want to customize based on your question :
CS1591(the second constructor parameter for ourSuppressionDescriptor)node is InterfaceDeclarationSyntax) or within an interface declaration (HasParentOfType<InterfaceDeclarationSyntax>(node))Note that the current code probably won't behave like you wish in a few edge cases like classes declared within an interface declaration but I think it's a pretty solid basis to start with.