Closed
Description
Steps to reproduce
Simple example:
$Array = @(); $Array.Count
$Hash = @{}; $Hash.Count
With a lint.psd1 of:
@{
IncludeDefaultRules = $True
Rules = @{
PSUseConsistentWhitespace = @{
Enable = $True
}
}
}
Execute
Invoke-ScriptAnalyzer -Path tmp.ps1 -settings lint.psd1
Expected behavior
I would expect
- Empty hash declarations to not cause a whitespace warning
OR - Empty array declarations to follow the same guidelines of empty hash declarations (requiring a space)
I would prefer option 1.
Actual behavior
Environment data
PS C:\tmp> System.Collections.Hashtable
Name Value
---- -----
PSVersion 5.1.17763.503
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.503
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS C:\tmp> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { .ToString()}
1.18.3