From 419da6c19bd87f4c9f76b5cb9c42c80608a8b23e Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Fri, 1 Nov 2024 05:36:53 -0400 Subject: [PATCH] fix(parser/clangtidy): skip empty category --- examples/clangtidy/sillycode | 2 +- internal/parser/clangtidy/score.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/clangtidy/sillycode b/examples/clangtidy/sillycode index a3e3c53..13fe889 160000 --- a/examples/clangtidy/sillycode +++ b/examples/clangtidy/sillycode @@ -1 +1 @@ -Subproject commit a3e3c533c8f986168a6b1a8621ce4034fd4eda04 +Subproject commit 13fe8890f87cd68125c48c19e1f9d4a21bc21383 diff --git a/internal/parser/clangtidy/score.go b/internal/parser/clangtidy/score.go index 4a92787..52bb4e5 100644 --- a/internal/parser/clangtidy/score.go +++ b/internal/parser/clangtidy/score.go @@ -25,6 +25,10 @@ func GetResult(jsonMessages []JsonMessage, conf Conf) (int, string) { parts := strings.Split(checkName, "-") if len(parts) > 0 { category := parts[0] + // checkName might be: -warnings-as-errors + if category == "" { + continue + } categoryCount[category] += 1 } }