Skip to content

1.x: Fix wiring of WhitespaceInsideBrace and WhitespaceAroundPipe that got broken in #1024 - #1142

Merged
TylerLeonhardt merged 8 commits into
PowerShell:legacy/1.xfrom
bergmeister:legacy/FixCherryPickWiring
Jan 8, 2020
Merged

TylerLeonhardt merged 8 commits into
PowerShell:legacy/1.xfrom
bergmeister:legacy/FixCherryPickWiring

Conversation

@bergmeister

@bergmeister Christoph Bergmeister (bergmeister) commented Jan 3, 2020 •

Copy link
Copy Markdown
Contributor

Fixes PowerShell/vscode-powershell#2375
More settings got broken in this bad cherry pick, I can only assume that there was a merge conflict that was resolved incorrectly.
To make it simpler in the future, I copied the method from master (hence the whitespace diff)
cc TylerLeonhardt

{ "CheckOperator", WhitespaceAroundOperator },
{ "CheckSeparator", WhitespaceAfterSeparator },
{ "CheckInnerBrace", WhitespaceInsideBrace },
{ "CheckPipe", WhitespaceAroundPipe },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line and the line above is the essential fix

"PSUseConsistentWhitespace",
"PSUseConsistentIndentation",
"PSAlignAssignmentStatement",
"PSAvoidUsingCmdletAliases",

@bergmeister Christoph Bergmeister (bergmeister) Jan 3, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry (the removed PSAvoidUsingCmdletAliases) is actually not necessary and was removed in PR #1056 in master, hence why this change is also brought back as well as the essential required thing is ruleConfigurations.Add("PSAvoidUsingCmdletAliases", new Hashtable()); a few lines above here for the autoCorrectAliases feature to work

@rjmholt Rob Holt (rjmholt) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we want to keep changes to a minimum in the 1.x branch, would you be able to take out all the formatting changes?

@bergmeister

Copy link
Copy Markdown
Contributor Author

Rob Holt (@rjmholt) I could but the whole point of bringing the formatting changes from master into the 1.x is branch that cherry-picking would work again without silly white-space merge conflicts that could lead to cause mistakes like this. Do you still not agree?

@rjmholt

Copy link
Copy Markdown
Contributor

cherry-picking would work again without silly white-space merge conflicts that could lead to cause mistakes like this

If that's the original cause of the issue then that's a fair point. I'll let TylerLeonhardt decide there.

There shouldn't be any more cherry picks though. This PR is probably the only change we'll make before a final release of the 1.x extension. Later this month the preview branch will become stable and preview/stable will behave like they were originally intended to.

@TylerLeonhardt TylerLeonhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TylerLeonhardt

Copy link
Copy Markdown
Member

Yeah I'm fine with that. I just reviewed the whole thing line-by-line. Looks good.

@TylerLeonhardt

Copy link
Copy Markdown
Member

Rob Holt (@rjmholt) can you review as well though?

@bergmeister

Christoph Bergmeister (bergmeister) commented Jan 8, 2020 •

Copy link
Copy Markdown
Contributor Author

Diff becomes much easier when hiding whitespaces.
image

@TylerLeonhardt
TylerLeonhardt merged commit 8f56a38 into PowerShell:legacy/1.x Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants