Split CheckPipe feature of trimming redundant whitespace out into option CheckPipeForRedundantWhitespace by bergmeister · Pull Request #1413 · PowerShell/PSScriptAnalyzer
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:
Checkpipestill corrects when there is no whitespace around the pipe operator- The new
CheckPipeForRedundantWhiteSpaceoption is for cases where redundant whitespace needs to be trimmed. Disabled by default.
PR Checklist
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Change is not breaking
- Make sure all
.cs,.ps1and.psm1files have the correct copyright header - Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation
- This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP:to the beginning of the title and remove the prefix when the PR is ready.
- If the PR is work in progress, please add the prefix
…ion CheckPipeForRedundantWhiteSpace
Christoph Bergmeister added 2 commits
|
|
||
| #### 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`. |
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:
vs
(GitHub seems to normalise spaces in inline code...)
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
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