We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8210765 commit a42fa1aCopy full SHA for a42fa1a
Tests/Rules/PlaceCloseBrace.tests.ps1
@@ -6,6 +6,7 @@ $settings = @{
6
PSPlaceCloseBrace = @{
7
Enable = $true
8
NoEmptyLineBefore = $true
9
+ IgnoreOneLineIf = $true
10
}
11
12
@@ -89,5 +90,13 @@ Get-Process * | % { "blah" }
89
90
It "Should not find a violation" {
91
$violations.Count | Should Be 0
92
93
+
94
+ It "Should ignore violations for one line if statement" {
95
+ $def = @'
96
+$x = if ($true) { "blah" } else { "blah blah" }
97
+'@
98
+ $violations = Invoke-ScriptAnalyzer -ScriptDefinition $def -Settings $settings
99
+ $violations.Count | Should Be 0
100
+ }
101
-}
102
+}
0 commit comments