Description
In an attempt to conform to the Allman
style indenting preferred by my team, I set powershell.codeFormatting.newLineAfterOpenBrace": false
and Format Document converted this:
if(Test-Path "C:\Program Files (x86)\PHP\5.6.26\CACert") {
$PEM = Get-Content $PEM.FullPath -raw
Add-Content "C:\Program Files (x86)\PHP\5.6.26\CACert\rootCA.pem" $Pem -Encoding ascii
} else {
Write-Warning "Failed to deploy PHP cert"
}
to this:
if(Test-Path "C:\Program Files (x86)\PHP\5.6.26\CACert")
{
$PEM = Get-Content $PEM.FullPath -raw
Add-Content "C:\Program Files (x86)\PHP\5.6.26\CACert\rootCA.pem" $Pem -Encoding ascii
} else
{
Write-Warning "Failed to deploy PHP cert"
}
I don't know what you call that half-cuddled else, but I just call it wrong 😉
If people have set "powershell.codeFormatting.openBraceOnSameLine": false,
you need to ditch the cuddled else as well -- or add a setting for elseOnSameLine
😀