Skip to content

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

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

Merged

Conversation

bergmeister
Copy link
Contributor

@bergmeister bergmeister commented Jan 3, 2020

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

@bergmeister bergmeister requested a review from rjmholt as a code owner January 3, 2020 17:13
{ "CheckOperator", WhitespaceAroundOperator },
{ "CheckSeparator", WhitespaceAfterSeparator },
{ "CheckInnerBrace", WhitespaceInsideBrace },
{ "CheckPipe", WhitespaceAroundPipe },
Copy link
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",
Copy link
Contributor Author

@bergmeister bergmeister Jan 3, 2020

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

Copy link
Contributor

@rjmholt rjmholt left a comment

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
Contributor Author

@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
Contributor

rjmholt commented Jan 3, 2020

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.

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

LGTM

@TylerLeonhardt
Copy link
Member

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

@TylerLeonhardt
Copy link
Member

@rjmholt can you review as well though?

@bergmeister
Copy link
Contributor Author

bergmeister commented Jan 8, 2020

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