GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — `PSPlaceOpenBrace` and `PSPlaceCloseBrace` leave trailing whitespace when expanding one-line blocks · Issue #2210 · PowerShell/PSScriptAnalyzer Open DescriptionSteps to reproduceFormat a one-line block with Invoke-Formatter -ScriptDefinition "if (`$x) { BREAK }" -Settings @{ IncludeRules = @( 'PSPlaceOpenBrace' 'PSPlaceCloseBrace' 'PSUseConsistentIndentation' 'PSUseCorrectCasing' ) Rules = @{ PSPlaceOpenBrace = @{ Enable = $true OnSameLine = $true NewLineAfter = $true IgnoreOneLineBlock = $false } PSPlaceCloseBrace = @{ Enable = $true NewLineAfter = $true IgnoreOneLineBlock = $false } PSUseConsistentIndentation = @{ Enable = $true } PSUseCorrectCasing = @{ Enable = $true } } } Expected behaviorExpanding the block should not introduce trailing whitespace: if ($x) { break } Actual behaviorThe output contains a trailing space after The brace corrections replace only the brace tokens. The spaces that separated the one-line content from the braces survive as trailing whitespace after the block is expanded. #1992 and merged #1993 are related, but not duplicates. They make Environment dataReproduced with:
Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |