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

SA1002: SemicolonsMustBeSpacedCorrectly #8

Closed
sharwell opened this issue Nov 18, 2014 · 3 comments · Fixed by #191
Closed

SA1002: SemicolonsMustBeSpacedCorrectly #8

sharwell opened this issue Nov 18, 2014 · 3 comments · Fixed by #191
Assignees

Comments

@sharwell
Copy link
Member

http://www.stylecop.com/docs/SA1002.html

@jackwhelpton
Copy link

The implementation of this rule is a little different from the original StyleCop version when it comes to the sections of a "for" loop. In the previous version, you would be nudged towards writing an "infinite" for loop as:

for (;;)
{
}

Other variants would trigger a violation of SA1002. By contrast, the only way to adhere to the rule now appears to be:

for (; ;)
{
}

which raised a violation of SA1002 in the previous version. Is this deliberate? The same difference is apparent if you add just an initializer to the loop.

I'm posting several queries of this style as I migrate an existing solution to use the StyleCop Analyzers; is it generally intended that the rules that existed in the previous version should preserve their behaviour?

@sharwell
Copy link
Member Author

@jackwhelpton It's normal for replies to "get lost" when they are added to issues that are already closed. You should open a new issue for items like this to make sure at a minimum that they get documented.

📝 Your comment is indirectly related to #633.

@jackwhelpton
Copy link

Raised #1489: cheers.

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

Successfully merging a pull request may close this issue.

2 participants