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

Support limiting CS1591 to certain members #74209

Open
Bartleby2718 opened this issue Jun 28, 2024 · 0 comments
Open

Support limiting CS1591 to certain members #74209

Bartleby2718 opened this issue Jun 28, 2024 · 0 comments

Comments

@Bartleby2718
Copy link

Brief description

I'd like to request a small enhancement to CS1591 Missing XML comment for publicly visible type or member 'Type_or_Member'.

My team almost always adds XML comments for public classes and enums but rarely for public methods or properties. Therefore, I'd like a more fine-grained control over CS1591. Namely, it'd be great if there's something like csharp_add_xml_comment_for_publicly_visible_type_or_member=class,enum, which would trigger CS1591 for classes and enums but not for methods or properties. Is this feasible? (Maybe not if the .editorconfig value can only be a single value...)

Languages applicable

C# only

Code example that the analyzer should report

C# file:

namespace MyNamespace;

public enum MyEnum // flagged
{
    One,
    Two,
}

public class MyClass // flagged
{
    public int MyProperty => 1; // not flagged

    public void MyMethod() => throw new NotImplementedException(); // not flagged
}

.editorconfig:

csharp_add_xml_comment_for_publicly_visible_type_or_member=class,enum:warning
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jun 28, 2024
@Cosifne Cosifne removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants