File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,15 @@ where-object {$_.Name -match 'powershell'}
124
124
$violations.Count | Should Be 1
125
125
}
126
126
127
+ It " Should not find a violation if a pipleline element is indented correctly" {
128
+ $def = @'
129
+ get-process |
130
+ where-object {$_.Name -match 'powershell'}
131
+ '@
132
+ $violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings
133
+ $violations.Count | Should Be 0
134
+ }
135
+
127
136
It " Should ignore comment in the pipleline" {
128
137
$def = @'
129
138
get-process |
@@ -134,14 +143,5 @@ select Name,Id |
134
143
$violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings
135
144
$violations.Count | Should Be 3
136
145
}
137
-
138
- It " Should not find a violation on a new line that follows a pipe" {
139
- $def = @'
140
- get-process |
141
- where-object {$_.Name -match 'powershell'}
142
- '@
143
- $violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings
144
- $violations.Count | Should Be 0
145
- }
146
146
}
147
147
}
You can’t perform that action at this time.
0 commit comments