Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Oct 24, 2020

PR Summary

Related: #1239

In order to enable formatting corrections of this kind: $a-join$b --> $a -join $b or reducing too much whitespace but also -split$a --> -split $a with the added code as existing code for operators assumes that something precedes it.
The reason for adding the check that the unary operator starts with a dash is is to exclude things like $a++ or !$a where we do not want a whitespace character separation by default

PR Checklist

@daviesj
Copy link
Contributor

daviesj commented Oct 27, 2020

I tried this code out and noticed a couple things.
Checking that the operator starts with a dash introduces the following undesirable behavior: --$counter is changed to -- $counter. Also $counter-- is changed to $counter --
Unary operator -not does not get spacing if it follows a parenthesis such as if (-not$SomeVariable).

Rules/UseConsistentWhitespace.cs Show resolved Hide resolved
@rjmholt rjmholt marked this pull request as draft April 21, 2021 20:57
@rjmholt
Copy link
Contributor

rjmholt commented Apr 21, 2021

Converting to draft to resolve the various PRs

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.