File tree Expand file tree Collapse file tree
.github/actions/Test-PSModule/src/tests/SourceCode/PSModule Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,24 +163,6 @@ Describe 'PSModule - SourceCode tests' {
163163 $issues -join [Environment ]::NewLine |
164164 Should - BeNullOrEmpty - Because " the script should use '`$ null = ...' instead of '... | Out-Null'"
165165 }
166- It ' Should not use ternary operations for compatibility reasons (ID: NoTernary)' - Skip {
167- $issues = @ (' ' )
168- $scriptFiles | ForEach-Object {
169- $filePath = $_.FullName
170- $relativePath = $filePath.Replace ($Path , ' ' ).Trim(' \' ).Trim(' /' )
171- $skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:NoTernary:(?<Reason>.+)' - AllMatches
172- if ($skipTest.Matches.Count -gt 0 ) {
173- $skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
174- Write-Host " ::warning title=Skipping NoTernary test:: - $relativePath - $skipReason "
175- } else {
176- Select-String - Path $filePath - Pattern ' (?<!\|)\s+\?\s' - AllMatches | ForEach-Object {
177- $issues += " - $relativePath `:L$ ( $_.LineNumber ) - $ ( $_.Line ) "
178- }
179- }
180- }
181- $issues -join [Environment ]::NewLine |
182- Should - BeNullOrEmpty - Because ' the script should not use ternary operations for compatibility with PS 5.1 and below'
183- }
184166 It ' all powershell keywords are lowercase (ID: LowercaseKeywords)' {
185167 $issues = @ (' ' )
186168 $scriptFiles | ForEach-Object {
You can’t perform that action at this time.
0 commit comments