fix(parser/clangtidy): ignore empty lines
This commit is contained in:
parent
e44537ea95
commit
7ff6dfb002
|
@ -6,6 +6,7 @@ import (
|
|||
"path/filepath"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Level int
|
||||
|
@ -68,6 +69,9 @@ func levelFromString(levelString string) Level {
|
|||
}
|
||||
|
||||
func isIgnored(line string) bool {
|
||||
if strings.TrimSpace(line) == "" {
|
||||
return true
|
||||
}
|
||||
ignoreRegex := regexp.MustCompile("^error:.*$")
|
||||
return ignoreRegex.MatchString(line)
|
||||
}
|
||||
|
|
|
@ -24,11 +24,6 @@ type ClangTidy struct{}
|
|||
func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
|
||||
stdout := executorResult.Files["stdout"]
|
||||
stderr := executorResult.Files["stderr"]
|
||||
|
||||
lines := strings.SplitAfter(stdout, "\n")
|
||||
messages := ParseLines(lines, conf)
|
||||
formattedMessages := Format(messages)
|
||||
|
||||
if executorResult.Status != stage.Status(envexec.StatusAccepted) {
|
||||
if !((executorResult.Status == stage.Status(envexec.StatusNonzeroExitStatus)) &&
|
||||
(executorResult.ExitStatus == 1)) {
|
||||
|
@ -41,6 +36,9 @@ func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
|
|||
}
|
||||
}
|
||||
}
|
||||
lines := strings.SplitAfter(stdout, "\n")
|
||||
messages := ParseLines(lines, conf)
|
||||
formattedMessages := Format(messages)
|
||||
score, comment := GetResult(formattedMessages, conf)
|
||||
return stage.ParserResult{
|
||||
Score: score,
|
||||
|
|
Loading…
Reference in New Issue
Block a user