-
Notifications
You must be signed in to change notification settings - Fork 397
Closed
Labels
Description
Steps to reproduce
Attaching our PSD fille for the analyzer config
We have
PSUseConsistentWhitespace with IgnoreAssignmentOperatorInsideHashTable = $true
PSAlignAssignmentStatement with Enabled = $true and CheckHashTable = $true
It generally works as advertised... except...
When a using statement is present... we get a "Use space before and after binary and assignment operators.PSScriptAnalyzer(PSUseConsistentWhitespace)" error.
This does not work ...
using namespace DoesNotMatter
$SoSad = @{
not = 'other'
theSame = 'casting sucks maybe?'
}
This works in our setup...
$SoHappy= @{
not = 'other'
theSame = 'casting sucks.'
}
``

Expected behavior
-----------------
No linting error.
Actual behavior
---------------
Seems to check inside hashtables when a using statement of ANY kind is present. The fixer works still though so it doesn't feel like something inherent with the type, maybe something to do with how using are tokenized?
D:\Symphony\devops-scripts\Symphony\Symphony.Azdo\Happy.ps1
Environment dataD:\Symphony\devops-scripts\Symphony\Symphony.Azdo\Sad.ps1
----------------
Present in a bunch of envs including our build farm...and using the latest version (1.24.0)
Attaching file
[PSScriptAnalyzerSettings.txt](https://github.com/user-attachments/files/19352089/PSScriptAnalyzerSettings.txt)