From 4f102120ea990bd272fe30b4c2298b6509ca366d Mon Sep 17 00:00:00 2001 From: kminoda Date: Tue, 4 Jun 2024 16:41:31 +0900 Subject: [PATCH] add statistics for cppcheck-all Signed-off-by: kminoda --- .github/workflows/cppcheck-all.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cppcheck-all.yaml b/.github/workflows/cppcheck-all.yaml index 6d0b75242505c..7e00229a91e59 100644 --- a/.github/workflows/cppcheck-all.yaml +++ b/.github/workflows/cppcheck-all.yaml @@ -33,4 +33,14 @@ jobs: - name: Run Cppcheck on all files run: | cppcheck --enable=all --inconclusive --check-level=exhaustive --xml . 2> cppcheck-report.xml - shell: bash \ No newline at end of file + shell: bash + + - name: Count errors by error ID and severity + run: | + #!/bin/bash + temp_file=$(mktemp) + grep -oP '(?<=id=")[^"]+" severity="[^"]+' cppcheck-report.xml | sed 's/" severity="/,/g' > "$temp_file" + echo "Error counts by error ID and severity:" + sort "$temp_file" | uniq -c + rm "$temp_file" + shell: bash