Closed
Description
Hi,
It seems like it is not possible to use both AlignAssignmentStatement and UseConsistentWhitespace rules because the first contradicts the second. UseConsistentWhitespace is enforcing that only one space is used before the operator while AlignAssignmentStatement assert that all "=" operators are aligned. The only way the analyzer would not fail is that all the keys from the hashtable are the same length ;)
To reproduce:
- Create a script with the following code:
$hashtable = @{
property1 = "value"
anotherProperty = "another value"
}
- Run the analyzer with code formatting settings:
Invoke-ScriptAnalyzer -Path MyScript.ps1 -Settings CodeFormatting
You should see a PSUseConsistentWhitespace rule warning
No warning should be the expected result