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

remove repetitions ';' #50236

Merged
merged 1 commit into from
Mar 26, 2021
Merged

remove repetitions ';' #50236

merged 1 commit into from
Mar 26, 2021

Conversation

kronic
Copy link
Contributor

@kronic kronic commented Mar 25, 2021

Cleanup code

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM. There's a related stylecop rule we should look at subsequently enabling.

@kronic
Copy link
Contributor Author

kronic commented Mar 25, 2021

@stephentoub I think now is the time. Where can I enable it?

@stephentoub
Copy link
Member

Where can I enable it?

You'd change the "None" in this line to be "Warning":

<Rule Id="SA1106" Action="None" /> <!-- Code should not contain empty statements -->

I've not tried and don't know what else it might flag. Feel free to try.

@stephentoub
Copy link
Member

stephentoub commented Mar 26, 2021

Turns out we can't enable SA1106. I just tried it, and it's flagging empty-body loops (which we allow) as empty statements (e.g. while (SomeCondition());).

@danmoseley
Copy link
Member

cc @sharwell

@sharwell
Copy link
Member

Turns out we can't enable SA1106. I just tried it, and it's flagging empty-body loops (which we allow) as empty statements

Yes, this is unlikely to change for StyleCop Analyzers. However, the relaxed form of the rule you want seems reasonably likely to get accept as part of the code style package in Roslyn so maybe we implement it there?

@stephentoub
Copy link
Member

@sharwell, sounds good to me.

@stephentoub stephentoub mentioned this pull request Apr 21, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 25, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants