Liam Peters
Liam Peters
@ThomasNieto This seems like a good idea to me 🙂 @bergmeister, This fails many of the tests as the path now always has some value. If `-ScriptDefinition` is supplied -...
This is a strange one. Ultimately [`ValidateSet` only accepts a string array of valid values](https://github.com/PowerShell/PowerShell/blob/ff3c8478983bfb566036362f8b629109fef8d180/src/System.Management.Automation/engine/Attributes.cs#L1777), so I guess it's going to cast `$True` and `$False` to `string` and be left...
Thanks for the explanation @JamesWTruher. Makes sense!
Hey @Ju-l1a 👋, You need to tell the formatter to include that rule when carrying out the formatting. ```powershell $Settings = @{ IncludeRules = @("PSAvoidTrailingWhitespace") Rules = @{ "PSAvoidTrailingWhitespace" =...
It looks as though the formatter considers each of the rules in the `ruleOrder` array, so adding it is correct. It does, however, skip over any rule that doesn't have...
Interestingly: ```powershell $script = @" Function Get-Example { 'Example' } " $settings = @{ Rules = @{ PSAvoidTrailingWhitespace = @{} } } $formatted = Invoke-Formatter -ScriptDefinition $script -Settings $settings ```...
This is quite an interesting one 😀. A slightly simplified repro in PSScriptAnalyzer is: ```powershell Invoke-Formatter -ScriptDefinition 'Invoke-Foo 3>&1 1>&1 2>&1' -Settings @{ Rules = @{ PSUseConsistentWhitespace = @{ Enable...
This looks to be being caused by rule `PSAlignAssignmentStatement`, not `PSUseConsistentWhitespace`. The simplest case where I can reproduce this is: ```powershell Invoke-Formatter -ScriptDefinition "@{'Key'='Value'}" -Settings @{ Rules = @{ PSAlignAssignmentStatement...
My git-foo is not strong so this is a re-raise of https://github.com/PowerShell/PSScriptAnalyzer/pull/1983 where the full test checks were completed and passed
Stepping through `Formatter.Format()` this behaviour arises from the `PSUseConsistentIndentation` rule. Specifically from: https://github.com/PowerShell/PSScriptAnalyzer/blob/a754b950467aa9e78a1eba1a3423bbd055ed8772/Rules/UseConsistentIndentation.cs#L165-L177 The issue seems to be that, if the left paren `(` is: - the first token (*first...