Skip to content
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

Split CheckPipe feature of trimming redundant whitespace out into option CheckPipeForRedundantWhitespace #1413

Merged

Conversation

@bergmeister
Copy link
Collaborator

bergmeister commented Feb 10, 2020

PR Summary

This is because some people align their pipes (e.g. in Pester tests) and don't want redundant white-space to be trimmed.
Therefore the concern of the rule options is split into 2 areas:

  • Checkpipe still corrects when there is no whitespace around the pipe operator
  • The new CheckPipeForRedundantWhiteSpace option is for cases where redundant whitespace needs to be trimmed. Disabled by default.

PR Checklist

…ion CheckPipeForRedundantWhiteSpace
Christoph Bergmeister
@bergmeister bergmeister marked this pull request as ready for review Feb 10, 2020
Christoph Bergmeister added 2 commits Feb 10, 2020
Christoph Bergmeister
Christoph Bergmeister
@bergmeister bergmeister requested review from JamesWTruher and rjmholt Feb 11, 2020

#### CheckPipeForRedundantWhitespace : bool (Default value is `$false`)

Checks if a pipe is surrounded by redundant whitespace (i.e. more than 1 whitespace). E.g. `foo | bar` instead of `foo|bar`.

This comment has been minimized.

@rjmholt

rjmholt Feb 11, 2020 Member

Is the example here accurate? Or is it something like:

foo    | bar

vs

foo | bar

(GitHub seems to normalise spaces in inline code...)

This comment has been minimized.

@bergmeister

bergmeister Feb 11, 2020 Author Collaborator

Yes, you're right, I forgot to update the example as well.

bergmeister and others added 2 commits Feb 11, 2020
Christoph Bergmeister
@bergmeister bergmeister merged commit 163d2c2 into PowerShell:master Feb 11, 2020
12 checks passed
12 checks passed
PSScriptAnalyzer-CI Build #20200211.3 succeeded
Details
PSScriptAnalyzer-CI (Build Full_Build) Build Full_Build succeeded
Details
PSScriptAnalyzer-CI (Test Ubuntu_16_04) Test Ubuntu_16_04 succeeded
Details
PSScriptAnalyzer-CI (Test Ubuntu_18_04) Test Ubuntu_18_04 succeeded
Details
PSScriptAnalyzer-CI (Test Windows_Server2016_PowerShell_5_1) Test Windows_Server2016_PowerShell_5_1 succeeded
Details
PSScriptAnalyzer-CI (Test Windows_Server2016_PowerShell_Core) Test Windows_Server2016_PowerShell_Core succeeded
Details
PSScriptAnalyzer-CI (Test Windows_Server2019_PowerShell_5_1) Test Windows_Server2019_PowerShell_5_1 succeeded
Details
PSScriptAnalyzer-CI (Test Windows_Server2019_PowerShell_Core) Test Windows_Server2019_PowerShell_Core succeeded
Details
PSScriptAnalyzer-CI (Test macOS_10_14_Mojave) Test macOS_10_14_Mojave succeeded
Details
PSScriptAnalyzer-CI (Test macOS_10_15_Catalina) Test macOS_10_15_Catalina succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla All CLA requirements met.
Details
@bergmeister bergmeister changed the title Split CheckPipe feature of trimming redundant whitespace out into option CheckPipeForRedundantWhiteSpace Split CheckPipe feature of trimming redundant whitespace out into option CheckPipeForRedundantWhitespace Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.