Finalize structured diagnostic aggregation
This commit is contained in:
@@ -50,12 +50,12 @@ func (v *Validator) Validate(_ context.Context, req contracts.TypedValidationReq
|
||||
}
|
||||
citedTexts[locationIndex] = citedText
|
||||
}
|
||||
warnings := make([]contracts.Warning, 0)
|
||||
warnings := make([]diagnostics.Finding, 0)
|
||||
for locationIndex, location := range req.Value.Locations {
|
||||
if shared.ContainsTokenSequence(citedTexts[locationIndex], location.Name) {
|
||||
continue
|
||||
}
|
||||
warnings = append(warnings, contracts.Warning{
|
||||
warnings = append(warnings, diagnostics.Finding{
|
||||
Scope: fmt.Sprintf("locations[%d]", locationIndex), ReasonCode: ReasonCode,
|
||||
Message: fmt.Sprintf("Location %s was not found in cited source text", diagnostics.Quote(location.Name)),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user