Skip to content

Commit

Permalink
chore(ci): add problem matcher for cppcheck (#7794)
Browse files Browse the repository at this point in the history
* chore(ci): add problem matcher for cppcheck

Signed-off-by: Kotaro Yoshimoto <[email protected]>

* chore(ci): setup problem matcher in cppcheck-differential

Signed-off-by: Kotaro Yoshimoto <[email protected]>

* test(ci): add diff to occur cppcheck errors 

Signed-off-by: Kotaro Yoshimoto <[email protected]>

* style(pre-commit): autofix

* Revert "test(ci): add diff to occur cppcheck errors "

This reverts commit 1c00fd5.

Signed-off-by: Kotaro Yoshimoto <[email protected]>

* chore(ci): setup problem matchers cppcheck-daily

Signed-off-by: Kotaro Yoshimoto <[email protected]>

---------

Signed-off-by: Kotaro Yoshimoto <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
HansRobo and pre-commit-ci[bot] authored Jul 3, 2024
1 parent f726e6a commit 598eca1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/cppcheck-problem-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "cppcheck",
"pattern": [
{
"regexp": "^([^:]+):(\\d+):(\\d*):\\s(style|portability|performance|warning|error):\\s(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 5
}
]
}
]
}
1 change: 1 addition & 0 deletions .github/workflows/cppcheck-daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
run: |
sudo snap install cppcheck
# cspell: ignore suppr
- name: Run Cppcheck on all files
continue-on-error: true
id: cppcheck
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/cppcheck-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
done
echo "full-paths=$paths" >> $GITHUB_OUTPUT
# cspell: ignore suppr
- name: Run Cppcheck on modified packages
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
continue-on-error: true
Expand All @@ -62,6 +63,9 @@ jobs:
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
shell: bash

- name: Setup Problem Matchers for cppcheck
run: echo "::add-matcher::.github/cppcheck-problem-matcher.json"

- name: Show cppcheck-report result
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
run: |
Expand Down

0 comments on commit 598eca1

Please sign in to comment.