-
Notifications
You must be signed in to change notification settings - Fork 395
Formatter adds spaces around a hyphen, but only if it is followed by a variable #847
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
Comments
this is really a reflection of the rule, right? The formatter seems a red-herring
|
@bergmeister hmm, I'm not really sure but shouldn't unary operators (which this is, right?) be excluded from that rule? This doesn't trigger the rule for example: Invoke-ScriptAnalyzer -Settings CodeFormatting -ScriptDefinition '$var = 6; (get-date).adddays(--$var)' So it doesn't seem logical that it triggers for a single hyphen either. |
@AWahlqvist Hmm, that's a good idea. I would need to first look at the |
I'm still experiencing this behavior, where |
I need to clarify, I was testing just Consider: |
Unformatted code:
Formatted code:
As you can see, the formatter adds spaces around a hyphen which is followed by a variable but does not add them if a hyphen is followed by a number. I think, the behavior should be consistent.
The text was updated successfully, but these errors were encountered: