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

PipelineIndentationStyle: Incorrect formatting when using None #1496

Closed
bergmeister opened this issue May 13, 2020 · 0 comments · Fixed by #1497
Closed

PipelineIndentationStyle: Incorrect formatting when using None #1496

bergmeister opened this issue May 13, 2020 · 0 comments · Fixed by #1497

Comments

@bergmeister
Copy link
Collaborator

bergmeister commented May 13, 2020

This can be repro-ed when setting the vs code setting powershell.codeFormatting.pipelineIndentationStyle to its new default None (default in PSSA is still NoIndentation)

Steps to reproduce

Invoke-Formatter -Settings @{ IncludeRules = @('PSUseConsistentIndentation'); Rules = @{ PSUseConsistentIndentation = @{ Enable = $true; PipelineIndentation = 'None' } }  } -ScriptDefinition @'         
@{
      foo      = "dfsf"
    bar = "dddff"
}

    foreach ($Test in $Test1) {
    foreach ($Test2 in $TEst3) {

    }
    }
'@

Expected behavior

@{
    foo = "dfsf"
    bar = "dddff"
}

foreach ($Test in $Test1) {
    foreach ($Test2 in $TEst3) {

    }
}

Actual behavior

@{
      foo      = "dfsf"
    bar = "dddff"
}

    foreach ($Test in $Test1) {
    foreach ($Test2 in $TEst3) {

    }

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

Environment data

PSSA 1.19.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants