@@ -27,85 +27,85 @@ Param(
27
27
28
28
BeforeAll {
29
29
$scriptFiles = Get-ChildItem - Path $Path - Include * .psm1, * .ps1 - Recurse - File
30
- LogGroup " - Script files [$ ( $scriptFiles.Count ) ]" {
31
- $scriptFiles | ForEach-Object {
32
- Write-Host " - $ ( $_.FullName ) "
33
- }
30
+ " ::group:: - Script files [$ ( $scriptFiles.Count ) ]"
31
+ $scriptFiles | ForEach-Object {
32
+ Write-Host " - $ ( $_.FullName ) "
34
33
}
34
+ ' ::endgroup::'
35
35
$functionsPath = Join-Path - Path $Path - ChildPath ' functions'
36
36
$functionFiles = (Test-Path - Path $functionsPath ) ? (Get-ChildItem - Path $functionsPath - File - Filter ' *.ps1' - Recurse) : $null
37
- LogGroup " - Function files [$ ( $functionFiles.Count ) ]" {
38
- $functionFiles | ForEach-Object {
39
- Write-Host " - $ ( $_.FullName ) "
40
- }
37
+ " ::group:: - Function files [$ ( $functionFiles.Count ) ]"
38
+ $functionFiles | ForEach-Object {
39
+ Write-Host " - $ ( $_.FullName ) "
41
40
}
41
+ ' ::endgroup::'
42
42
$privateFunctionsPath = Join-Path - Path $functionsPath - ChildPath ' private'
43
43
$privateFunctionFiles = (Test-Path - Path $privateFunctionsPath ) ?
44
44
(Get-ChildItem - Path $privateFunctionsPath - File - Filter ' *.ps1' - Recurse) : $null
45
- LogGroup " - Private [$ ( $privateFunctionFiles.Count ) ]" {
46
- $privateFunctionFiles | ForEach-Object {
47
- Write-Host " - $ ( $_.FullName ) "
48
- }
45
+ " ::group:: - Private [$ ( $privateFunctionFiles.Count ) ]"
46
+ $privateFunctionFiles | ForEach-Object {
47
+ Write-Host " - $ ( $_.FullName ) "
49
48
}
49
+ ' ::endgroup::'
50
50
$publicFunctionsPath = Join-Path - Path $functionsPath - ChildPath ' public'
51
51
$publicFunctionFiles = (Test-Path - Path $publicFunctionsPath ) ? (Get-ChildItem - Path $publicFunctionsPath - File - Filter ' *.ps1' - Recurse) : $null
52
- LogGroup " - Public [$ ( $publicFunctionFiles.Count ) ]" {
53
- $publicFunctionFiles | ForEach-Object {
54
- Write-Host " - $ ( $_.FullName ) "
55
- }
52
+ " ::group:: - Public [$ ( $publicFunctionFiles.Count ) ]"
53
+ $publicFunctionFiles | ForEach-Object {
54
+ Write-Host " - $ ( $_.FullName ) "
56
55
}
56
+ ' ::endgroup::'
57
57
$variablesPath = Join-Path - Path $Path - ChildPath ' variables'
58
58
$variableFiles = (Test-Path - Path $variablesPath ) ? (Get-ChildItem - Path $variablesPath - File - Filter ' *.ps1' - Recurse) : $null
59
- LogGroup " - Variable files [$ ( $variableFiles.Count ) ]" {
60
- $variableFiles | ForEach-Object {
61
- Write-Host " - $ ( $_.FullName ) "
62
- }
59
+ " ::group:: - Variable files [$ ( $variableFiles.Count ) ]"
60
+ $variableFiles | ForEach-Object {
61
+ Write-Host " - $ ( $_.FullName ) "
63
62
}
63
+ ' ::endgroup::'
64
64
$privateVariablesPath = Join-Path - Path $variablesPath - ChildPath ' private'
65
65
$privateVariableFiles = (Test-Path - Path $privateVariablesPath ) ?
66
66
(Get-ChildItem - Path $privateVariablesPath - File - Filter ' *.ps1' - Recurse) : $null
67
- LogGroup " - Private [$ ( $privateVariableFiles.Count ) ]" {
68
- $privateVariableFiles | ForEach-Object {
69
- Write-Host " - $ ( $_.FullName ) "
70
- }
67
+ " ::group:: - Private [$ ( $privateVariableFiles.Count ) ]"
68
+ $privateVariableFiles | ForEach-Object {
69
+ Write-Host " - $ ( $_.FullName ) "
71
70
}
71
+ ' ::endgroup::'
72
72
$publicVariablesPath = Join-Path - Path $variablesPath - ChildPath ' public'
73
73
$publicVariableFiles = (Test-Path - Path $publicVariablesPath ) ?
74
74
(Get-ChildItem - Path $publicVariablesPath - File - Filter ' *.ps1' - Recurse) : $null
75
- LogGroup " - Public [$ ( $publicVariableFiles.Count ) ]" {
76
- $publicVariableFiles | ForEach-Object {
77
- Write-Host " - $ ( $_.FullName ) "
78
- }
75
+ " ::group:: - Public [$ ( $publicVariableFiles.Count ) ]"
76
+ $publicVariableFiles | ForEach-Object {
77
+ Write-Host " - $ ( $_.FullName ) "
79
78
}
79
+ ' ::endgroup::'
80
80
$classPath = Join-Path - Path $Path - ChildPath ' classes'
81
81
$classFiles = (Test-Path - Path $classPath ) ? (Get-ChildItem - Path $classPath - File - Filter ' *.ps1' - Recurse) : $null
82
- LogGroup " - Class [$ ( $classFiles.Count ) ]" {
83
- $classFiles | ForEach-Object {
84
- Write-Host " - $ ( $_.FullName ) "
85
- }
82
+ " ::group:: - Class [$ ( $classFiles.Count ) ]"
83
+ $classFiles | ForEach-Object {
84
+ Write-Host " - $ ( $_.FullName ) "
86
85
}
86
+ ' ::endgroup::'
87
87
$privateClassPath = Join-Path - Path $classPath - ChildPath ' private'
88
88
$privateClassFiles = (Test-Path - Path $privateClassPath ) ?
89
89
(Get-ChildItem - Path $privateClassPath - File - Filter ' *.ps1' - Recurse) : $null
90
- LogGroup " - Private [$ ( $privateClassFiles.Count ) ]" {
91
- $privateClassFiles | ForEach-Object {
92
- Write-Host " - $ ( $_.FullName ) "
93
- }
90
+ " ::group:: - Private [$ ( $privateClassFiles.Count ) ]"
91
+ $privateClassFiles | ForEach-Object {
92
+ Write-Host " - $ ( $_.FullName ) "
94
93
}
94
+ ' ::endgroup::'
95
95
$publicClassPath = Join-Path - Path $classPath - ChildPath ' public'
96
96
$publicClassFiles = (Test-Path - Path $publicClassPath ) ?
97
97
(Get-ChildItem - Path $publicClassPath - File - Filter ' *.ps1' - Recurse) : $null
98
- LogGroup " - Public [$ ( $publicClassFiles.Count ) ]" {
99
- $publicClassFiles | ForEach-Object {
100
- Write-Host " - $ ( $_.FullName ) "
101
- }
98
+ " ::group:: - Public [$ ( $publicClassFiles.Count ) ]"
99
+ $publicClassFiles | ForEach-Object {
100
+ Write-Host " - $ ( $_.FullName ) "
102
101
}
102
+ ' ::endgroup::'
103
103
$testFiles = Get-ChildItem - Path $TestsPath - Include * .Tests.ps1 - Recurse - File
104
- LogGroup " - Test files [$ ( $testFiles.Count ) ]" {
105
- $testFiles | ForEach-Object {
106
- Write-Host " - $ ( $_.FullName ) "
107
- }
104
+ " ::group:: - Test files [$ ( $testFiles.Count ) ]"
105
+ $testFiles | ForEach-Object {
106
+ Write-Host " - $ ( $_.FullName ) "
108
107
}
108
+ ' ::endgroup::'
109
109
}
110
110
111
111
Describe ' PSModule - SourceCode tests' {
@@ -119,7 +119,7 @@ Describe 'PSModule - SourceCode tests' {
119
119
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:NumberOfProcessors:(?<Reason>.+)' - AllMatches
120
120
if ($skipTest.Matches.Count -gt 0 ) {
121
121
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
122
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping NumberOfProcessors test '
122
+ " ::warning title=Skipping NumberOfProcessors test:: - $relativePath - $skipReason "
123
123
} else {
124
124
$issues += " - $ ( $_.Path ) :L$ ( $_.LineNumber ) "
125
125
}
@@ -136,7 +136,7 @@ Describe 'PSModule - SourceCode tests' {
136
136
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:Verbose:(?<Reason>.+)' - AllMatches
137
137
if ($skipTest.Matches.Count -gt 0 ) {
138
138
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
139
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping Verbose test '
139
+ " ::warning title=Skipping Verbose test:: - $relativePath - $skipReason "
140
140
} else {
141
141
Select-String - Path $filePath - Pattern ' \s(-Verbose(?::\$true)?)\b(?!:\$false)' - AllMatches | ForEach-Object {
142
142
$issues += " - $relativePath `:L$ ( $_.LineNumber ) - $ ( $_.Line ) "
@@ -154,7 +154,7 @@ Describe 'PSModule - SourceCode tests' {
154
154
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:OutNull:(?<Reason>.+)' - AllMatches
155
155
if ($skipTest.Matches.Count -gt 0 ) {
156
156
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
157
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping OutNull test '
157
+ " ::warning title=Skipping OutNull test:: - $relativePath - $skipReason "
158
158
} else {
159
159
Select-String - Path $filePath - Pattern ' Out-Null' - AllMatches | ForEach-Object {
160
160
$issues += " - $relativePath `:L$ ( $_.LineNumber ) - $ ( $_.Line ) "
@@ -172,7 +172,7 @@ Describe 'PSModule - SourceCode tests' {
172
172
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:NoTernary:(?<Reason>.+)' - AllMatches
173
173
if ($skipTest.Matches.Count -gt 0 ) {
174
174
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
175
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping NoTernary test '
175
+ " ::warning title=Skipping NoTernary test:: - $relativePath - $skipReason "
176
176
} else {
177
177
Select-String - Path $filePath - Pattern ' (?<!\|)\s+\?\s' - AllMatches | ForEach-Object {
178
178
$issues += " - $relativePath `:L$ ( $_.LineNumber ) - $ ( $_.Line ) "
@@ -190,7 +190,7 @@ Describe 'PSModule - SourceCode tests' {
190
190
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:LowercaseKeywords:(?<Reason>.+)' - AllMatches
191
191
if ($skipTest.Matches.Count -gt 0 ) {
192
192
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
193
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping LowercaseKeywords test '
193
+ " ::warning title=Skipping LowercaseKeywords test:: - $relativePath - $skipReason "
194
194
} else {
195
195
$errors = $null
196
196
$tokens = $null
@@ -246,7 +246,7 @@ Describe 'PSModule - SourceCode tests' {
246
246
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:FunctionCount:(?<Reason>.+)' - AllMatches
247
247
if ($skipTest.Matches.Count -gt 0 ) {
248
248
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
249
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping FunctionCount test '
249
+ " ::warning title=Skipping FunctionCount test:: - $relativePath - $skipReason "
250
250
} else {
251
251
$Ast = [System.Management.Automation.Language.Parser ]::ParseFile($filePath , [ref ]$null , [ref ]$null )
252
252
$tokens = $Ast.FindAll ( { $args [0 ] -is [System.Management.Automation.Language.FunctionDefinitionAst ] } , $true )
@@ -267,7 +267,7 @@ Describe 'PSModule - SourceCode tests' {
267
267
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:FunctionName:(?<Reason>.+)' - AllMatches
268
268
if ($skipTest.Matches.Count -gt 0 ) {
269
269
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
270
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping FunctionName test '
270
+ " ::warning title=Skipping FunctionName test:: - $relativePath - $skipReason "
271
271
} else {
272
272
$Ast = [System.Management.Automation.Language.Parser ]::ParseFile($filePath , [ref ]$null , [ref ]$null )
273
273
$tokens = $Ast.FindAll ( { $args [0 ] -is [System.Management.Automation.Language.FunctionDefinitionAst ] } , $true )
@@ -288,7 +288,7 @@ Describe 'PSModule - SourceCode tests' {
288
288
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:CmdletBinding:(?<Reason>.+)' - AllMatches
289
289
if ($skipTest.Matches.Count -gt 0 ) {
290
290
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
291
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping CmdletBinding test '
291
+ " ::warning title=Skipping CmdletBinding test:: - $relativePath - $skipReason "
292
292
} else {
293
293
$scriptAst = [System.Management.Automation.Language.Parser ]::ParseFile($filePath , [ref ]$null , [ref ]$null )
294
294
$tokens = $scriptAst.FindAll ({ $true }, $true )
@@ -314,7 +314,7 @@ Describe 'PSModule - SourceCode tests' {
314
314
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:ParamBlock:(?<Reason>.+)' - AllMatches
315
315
if ($skipTest.Matches.Count -gt 0 ) {
316
316
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
317
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping ParamBlock test '
317
+ " ::warning title=Skipping ParamBlock test:: - $relativePath - $skipReason "
318
318
} else {
319
319
$scriptAst = [System.Management.Automation.Language.Parser ]::ParseFile($filePath , [ref ]$null , [ref ]$null )
320
320
$tokens = $scriptAst.FindAll ({ $args [0 ] -is [System.Management.Automation.Language.ParamBlockAst ] }, $true )
@@ -366,7 +366,7 @@ Describe 'PSModule - SourceCode tests' {
366
366
$skipTest = Select-String - Path $filePath - Pattern ' #SkipTest:FunctionTest:(?<Reason>.+)' - AllMatches
367
367
if ($skipTest.Matches.Count -gt 0 ) {
368
368
$skipReason = $skipTest.Matches.Groups | Where-Object { $_.Name -eq ' Reason' } | Select-Object - ExpandProperty Value
369
- Write-GitHubWarning - Message " - $relativePath - $skipReason " - Title ' Skipping FunctionTest test '
369
+ " ::warning title=Skipping FunctionTest test:: - $relativePath - $skipReason "
370
370
} else {
371
371
$Ast = [System.Management.Automation.Language.Parser ]::ParseFile($filePath , [ref ]$null , [ref ]$null )
372
372
$tokens = $Ast.FindAll ( { $args [0 ] -is [System.Management.Automation.Language.FunctionDefinitionAst ] } , $true )
0 commit comments