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
@{
IncludeRules=@(
'PSUseConsistentWhitespace')
Rules=@{
PSUseConsistentWhitespace=@{
# Checks if there is a space between a keyword and its corresponding open brace.# E.g. foo { } instead of foo{ }# default = true (powershell.codeFormatting.whitespaceBeforeOpenBrace)CheckOpenBrace=$true
}
}
And here is sample test function, not that open brace is not new line!
functionTest-Foo()
{
}
Expected behavior
No warning is shown for bellow function
# NO WARNING HEREfunctionTest-Foo()
{
}
Actual behavior
Warning is shown because brace is on next line, there is no need for any space here, This warning is valid only if open brace is on same line as function name.
# PSUseConsistentWhitespace Warning Use space before open brace.functionTest-Foo()
{
}
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 7.0.2
PSEdition Core
GitCommitId 7.0.2
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0> (Get-Module-ListAvailable PSScriptAnalyzer).Version |ForEach-Object { $_.ToString() }
1.19.0
The text was updated successfully, but these errors were encountered:
Thanks for taking the time to report it. I can verify this happens with 1.19.0 but I am happy to say we have fixed this in master already by PR #1491
We will briefly discuss this issue at the next triage session since there are also other recently fixed cases that would warrant releasing some of the recent fixes in a new patch release, therefore expect this issue to get closed soon but you'll have to wait for the next release in the meantime.
Steps to reproduce
Here is setting snapshot I'm trying to use:
And here is sample test function, not that open brace is not new line!
Expected behavior
No warning is shown for bellow function
Actual behavior
Warning is shown because brace is on next line, there is no need for any space here,
This warning is valid only if open brace is on same line as function name.
Environment data
The text was updated successfully, but these errors were encountered: