You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
Activity
bjornhellander commentedon Aug 1, 2023
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?
sharwell commentedon Aug 7, 2023
It's not listed in known issues:
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/KnownChanges.md#sa1025
Based on the age of the current behavior, I lean towards not making a change here (and instead updating the documentation).
Update SA1025 documentation to reflect handling of multiple spaces pr…