File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ public void Analyze(
117
117
string moduleName = psd1FileName . Replace ( ".psd1" , "" ) ;
118
118
Directory . SetCurrentDirectory ( directory ) ;
119
119
120
- Console . WriteLine ( "Analysing module: {0}" , moduleName ) ;
120
+ Console . WriteLine ( "Analyzing module: {0}" , moduleName ) ;
121
121
processedHelpFiles . Add ( moduleName ) ;
122
122
123
123
var newModuleMetadata = MetadataLoader . GetModuleMetadata ( moduleName ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,40 @@ $SavePath = $PWD
31
31
32
32
$MissReadMe = 9000
33
33
$GenSdkChanged = 9090
34
+
35
+ function EnsureModuleName {
36
+ param ([string ]$moduleName )
37
+ if (-not [System.String ]::IsNullOrEmpty($moduleName ) -and -not $moduleName.StartsWith (" Az." ))
38
+ {
39
+ return " Az.$moduleName "
40
+ }
41
+ return $moduleName
42
+ }
43
+
44
+ function Get-NonExceptionSdkRecord {
45
+ param (
46
+ [GeneratedSdkIssue []]$records
47
+ )
48
+ $exceptionPaths = " $PSScriptRoot \..\..\..\tools\StaticAnalysis\Exceptions"
49
+ $errors = @ ()
50
+ foreach ($record in $records ){
51
+ $exceptionPath = Join-Path - Path $exceptionPaths - ChildPath (EnsureModuleName($record.Module )) - AdditionalChildPath " GeneratedSdkIssues.csv"
52
+ if (Test-Path - Path $exceptionPath ){
53
+ $exceptionContents = Import-Csv - Path $exceptionPath
54
+ foreach ($exceptionContent in $exceptionContents ) {
55
+ if ($exceptionContent.Module -eq $record.Module -and $exceptionContent.Sdk -eq $record.Sdk -and $exceptionContent.Severity -eq $record.Severity -and $exceptionContent.ProblemId -eq $record.ProblemId -and $exceptionContent.Description -eq $record.Description ){
56
+ $needAdd = $false
57
+ break
58
+ }
59
+ }
60
+ }
61
+ if ($needAdd ){
62
+ $errors += $record
63
+ }
64
+ }
65
+ return $errors
66
+ }
67
+
34
68
try {
35
69
if ((Test-Path $FilesChangedPaths - PathType Leaf) -and $FilesChangedPaths.EndsWith (" .txt" )) {
36
70
# Read Changedfiles and check if generted sdk code is updated.
@@ -136,6 +170,7 @@ try {
136
170
}
137
171
Set-Location $SavePath
138
172
}
173
+ $ExceptionList = Get-NonExceptionSdkRecord $ExceptionList
139
174
}
140
175
catch {
141
176
Write-Host " An error occurred: $_ "
You can’t perform that action at this time.
0 commit comments