You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extracted from this comment of @mrboring : #1032 (comment)
This happens still on master even due to the recent fix for recognizing single line pipelines.
The following code results in a PSUseConsistentIndentation problem. It refers to the second from last closing brace:
Describe -Name 'Test'-Fixture {
It -Name 'Test'-Test {
{1/0-or`2/0} | Should throw
}
}
If I format the document using Shift+Alt+F I get:
Describe -Name 'Test'-Fixture {
It -Name 'Test'-Test {
{1/0-or`2/0} | Should throw
}
}
Notice that the second from last closing brace has been unindented.
Strangely, if I move the Should throw to a new line, and format the document, the PSUseConsistentIndentation problem goes away:
Describe -Name 'Test'-Fixture {
It -Name 'Test'-Test {
{1/0-or`2/0} |
Should throw
}
}
Name Value
---------
PSVersion 6.2.2
PSEdition Core
GitCommitId 6.2.2
OS Microsoft Windows 10.0.18362
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Uh oh!
There was an error while loading. Please reload this page.
Extracted from this comment of @mrboring : #1032 (comment)
This happens still on master even due to the recent fix for recognizing single line pipelines.
The following code results in a PSUseConsistentIndentation problem. It refers to the second from last closing brace:
If I format the document using
Shift+Alt+F
I get:Notice that the second from last closing brace has been unindented.
Strangely, if I move the
Should throw
to a new line, and format the document, the PSUseConsistentIndentation problem goes away:VS Code
Installed Extensions for VS Code
> $PSVersionTable
> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
Various Settings Files
settings.json
PSScriptAnalyzerSettings.psd1
CustomRule.psm1
Various configuration files.zip
Originally posted by @mrboring in #1032 (comment)
The text was updated successfully, but these errors were encountered: