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

@bergmeister bergmeister marked this pull request as ready for review February 10, 2020 09:40

#### 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`.
Copy link
Contributor

Choose a reason for hiding this comment

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

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

foo    | bar

vs

foo | bar

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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

@bergmeister bergmeister merged commit 163d2c2 into PowerShell:master Feb 11, 2020
@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
Development

Successfully merging this pull request may close these issues.

None yet

2 participants