Finalize structured diagnostic aggregation
This commit is contained in:
@@ -107,20 +107,6 @@ func appendDiagnosticGroups(output *RunOutput, groups []contracts.DiagnosticGrou
|
||||
}
|
||||
cloned := contracts.CloneDiagnosticCollection(contracts.DiagnosticCollection{Groups: groups}).Groups
|
||||
output.diagnosticGroups = append(output.diagnosticGroups, cloned...)
|
||||
seen := make(map[contracts.Warning]struct{}, len(output.Warnings))
|
||||
for _, warning := range output.Warnings {
|
||||
seen[warning] = struct{}{}
|
||||
}
|
||||
for _, group := range cloned {
|
||||
for _, sample := range group.Samples {
|
||||
warning := contracts.Warning{Scope: sample.Scope, ReasonCode: group.ReasonCode, Message: sample.Message}
|
||||
if _, exists := seen[warning]; exists {
|
||||
continue
|
||||
}
|
||||
output.Warnings = append(output.Warnings, warning)
|
||||
seen[warning] = struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func finalizeDiagnostics(output *RunOutput) error {
|
||||
|
||||
Reference in New Issue
Block a user