From bcaed579e5fb693706e9d4034ca94abb3ee67e8f Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Mon, 4 Nov 2024 04:07:24 -0500 Subject: [PATCH] feat(parser/cppcheck): match both id and severity --- internal/parser/cppcheck/score.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/parser/cppcheck/score.go b/internal/parser/cppcheck/score.go index 4cb26b4..d7863f5 100644 --- a/internal/parser/cppcheck/score.go +++ b/internal/parser/cppcheck/score.go @@ -87,7 +87,8 @@ func GetResult(records []Record, conf Conf) (string, int, error) { for _, record := range records { for _, match := range conf.Matches { for _, keyword := range match.Keywords { - if strings.Contains(record.Id, keyword) { + if strings.Contains(record.Id, keyword) || + strings.Contains(record.Severity, keyword) { matchCount[keyword] += 1 scoreChange[keyword] += -match.Score score += -match.Score