Skip to content

Commit 2cc64a5

Browse files
committed
Fix DartAnalyzer sarif/driver generation
1 parent a6a6368 commit 2cc64a5

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

cmd/upload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func resultsFinalWithAPIToken(commitUUID string, apiToken string, provider strin
208208

209209
func getPatternByID(patterns []Pattern, patternID string) *Pattern {
210210
for _, p := range patterns {
211-
if p.ID == patternID {
211+
if strings.EqualFold(p.ID, patternID) {
212212
return &p
213213
}
214214
}

tools/dartanalyzerRunner.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ func RunDartAnalyzer(workDirectory string, installationDirectory string, binary
5959
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
6060
"runs": []map[string]interface{}{
6161
{
62+
"tool": map[string]interface{}{
63+
"driver": map[string]interface{}{
64+
"name": "dartanalyzer",
65+
},
66+
},
6267
"results": []map[string]interface{}{},
6368
},
6469
},

tools/testdata/repositories/dartanalizer/expected.sarif

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@
129129
},
130130
"ruleId": "UNUSED_LOCAL_VARIABLE"
131131
}
132-
]
132+
],
133+
"tool": {
134+
"driver": {
135+
"name": "dartanalyzer"
136+
}
137+
}
133138
}
134139
]
135140
}

0 commit comments

Comments
 (0)