Skip to content

Commit de7ff97

Browse files
remove non-relevant error messages
1 parent 4b088a2 commit de7ff97

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

internal/tool/command.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,13 @@ func appendErrorToResult(result []codacy.Result, semgrepOutput SemgrepOutput) []
191191
// The error message already with sizeMessage length
192192
truncatedMessage := semgrepError.Message[:sizeMessage]
193193

194-
// Append the error to the result
194+
// Append the error to the result but only if it doesn't contain
195+
// "Syntax error at line" to avoid logging syntax errors that are not relevant for the user
195196
if !strings.Contains(truncatedMessage, "Syntax error at line") {
196197
result = append(result, codacy.FileError{
197198
Message: truncatedMessage,
198199
File: semgrepError.Location.Path,
199200
})
200-
} else {
201-
result = append(result, codacy.FileError{
202-
Message: "The file could not be parsed, likely due to syntax errors.",
203-
File: semgrepError.Location.Path,
204-
})
205201
}
206202
}
207203
return result

test.c

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)