Skip to content

Commit 598eca1

Browse files
chore(ci): add problem matcher for cppcheck (#7794)
* chore(ci): add problem matcher for cppcheck Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> * chore(ci): setup problem matcher in cppcheck-differential Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> * test(ci): add diff to occur cppcheck errors Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> * style(pre-commit): autofix * Revert "test(ci): add diff to occur cppcheck errors " This reverts commit 1c00fd5. Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> * chore(ci): setup problem matchers cppcheck-daily Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> --------- Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f726e6a commit 598eca1

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.github/cppcheck-problem-matcher.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "cppcheck",
5+
"pattern": [
6+
{
7+
"regexp": "^([^:]+):(\\d+):(\\d*):\\s(style|portability|performance|warning|error):\\s(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 5
12+
}
13+
]
14+
}
15+
]
16+
}

.github/workflows/cppcheck-daily.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
run: |
1919
sudo snap install cppcheck
2020
21+
# cspell: ignore suppr
2122
- name: Run Cppcheck on all files
2223
continue-on-error: true
2324
id: cppcheck

.github/workflows/cppcheck-differential.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
done
5454
echo "full-paths=$paths" >> $GITHUB_OUTPUT
5555
56+
# cspell: ignore suppr
5657
- name: Run Cppcheck on modified packages
5758
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
5859
continue-on-error: true
@@ -62,6 +63,9 @@ jobs:
6263
cppcheck --enable=all --inconclusive --check-level=exhaustive --error-exitcode=1 --suppressions-list=.cppcheck_suppressions --inline-suppr ${{ steps.get-full-paths.outputs.full-paths }} 2> cppcheck-report.txt
6364
shell: bash
6465

66+
- name: Setup Problem Matchers for cppcheck
67+
run: echo "::add-matcher::.github/cppcheck-problem-matcher.json"
68+
6569
- name: Show cppcheck-report result
6670
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
6771
run: |

0 commit comments

Comments
 (0)