Skip to content

PSUseConsistentIndentation: Identation missing if command was broken over multiple lines #1406

Closed
@felixfbecker

Description

@felixfbecker

Before submitting a bug report:

  • Make sure you are able to repro it on the latest released version
  • Perform a quick search for existing issues to check if this bug has already been reported

Steps to reproduce

Format this file: https://github.com/pcgeek86/PSGitHub/blob/5fa152568f3218843bbec97c5604d6b16b03066f/Functions/Public/New-GitHubPullRequest.ps1#L183

with

        PSUseConsistentIndentation = @{
            Enable = $true
            Kind = 'space'
            IndentationSize = 4
            PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
        }

Expected behavior

Should stay the same

Actual behavior

Output (indendation wrong after the pipe):

        if ($Labels -or $TeamAssignees -or $Assignees -or $MilestoneTitle -or $MilestoneNumber) {
            # Update PR with issue properties
            $pr = $pr | Update-GitHubIssue `
                -TeamAssignees $TeamAssignees `
                -Assignees $Assignees `
                -MilestoneNumber $MilestoneNumber `
                -MilestoneTitle $MilestoneTitle `
                -Labels $Labels `
                -Token $Token |
            # Update PR object
            Get-GitHubPullRequest -Token $Token
    }

    if ($Reviewers -or $TeamReviewers) {
        $pr = $pr | New-GitHubReviewRequest -Reviewers $Reviewers -TeamReviewers $TeamReviewers -Token $Token
    }
    if ($ProjectColumnId) {
        New-GitHubProjectCard -ColumnId $ProjectColumnId -ContentType PullRequest -ContentId $pr.Id -Token $Token
    }

    $pr
}
}

If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *

Environment data

Name                           Value
----                           -----
PSVersion                      6.2.4
PSEdition                      Core
GitCommitId                    6.2.4
OS                             Darwin 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov  9 03:47:04 PST 2019; root:xnu-6153…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

1.18.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions