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

SA1623 - Incorrect Error on Read-Only Peoperty #2253

Closed
Busy-Coding opened this issue Dec 15, 2016 · 3 comments
Closed

SA1623 - Incorrect Error on Read-Only Peoperty #2253

Busy-Coding opened this issue Dec 15, 2016 · 3 comments

Comments

@Busy-Coding
Copy link

Consider a read only property with read/write verbiage copypasta:

/// <summary>  
/// Gets or sets the path to the object's class.  
/// </summary>  
public ManagementPath ClassPath => this.managementObject.ClassPath;

SA1623 tags this with the misleading message "text must begin with: Gets", and auto-fix changes the summary to "Gets gets or sets".

@bjornhellander
Copy link
Contributor

The error is correctly reported. Since there is no setter, the summary should start with "Gets" instead of "Gets or sets". I do however agree that the message might be seen as misleading, since the summary actually does start with "Gets". And the code fix must certainly messes up.

In 1.1.0-beta001, the code fix works as expected, but the error is now reported as SA1624 which seems wrong to me since this has nothing to do with the accessibility of the property's accessors.

This is the message I get with the beta version:

Warning SA1624: Because the property only contains a visible get accessor, the documentation summary text must begin with 'Gets'. The documentation text within a C# property’s <summary> tag takes into account all of the accessors within the property, but one of the accessors has limited access.

@vweijsters
Copy link
Contributor

Marking this a bug, as SA1623 should be raised in this case.

@bjornhellander
Copy link
Contributor

I can fix this

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