-
Notifications
You must be signed in to change notification settings - Fork 510
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
SA1025 possible bug #3684
Comments
Well, I see no trace of taking symbols into consideration in this rule's code. If that was intended, then it looks a bit like a bug. If this is the original StyleCop code, then it definitely handles spaces preceding symbols/operators somehow: https://github.com/StyleCop/StyleCop/blob/7da86d484c6487c5fff1ae84cbd41c03c5c212d8/Project/Src/StyleCop.CSharp.Rules/SpacingRules.cs#L1964-L1978, I tried the StyleCop plugin to Resharper and that one did not complain about the provided code example. I also tried with extra spaces before +, - * etc and it did not trigger in any of those cases. Could not find anything relevant in the KnownChanges.md document, or in the open/closed issues. @sharwell, do you remember any intentional deviations in this rule? Any opinions? |
It's not listed in known issues: Based on the age of the current behavior, I lean towards not making a change here (and instead updating the documentation). |
Consider the following code:
For readability I like to have all the
=
aligned in the flags enum. This triggers rule SA1025 due to having multiple whitespace characters in a row, however if I understand the documentation correctly this should be an exception.Rule description for reference:
A violation of this rule occurs whenever the code contains multiple whitespace characters in a row, unless the characters come at the beginning or end of a line of code, following a comma or semicolon or preceding a symbol.
If it's not a bug but working as intended, I'd like to request that an exception be added for this case.
The text was updated successfully, but these errors were encountered: