Skip to content

Commit

Permalink
cppcheck action
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-hanqing committed Sep 18, 2023
1 parent 2ddafb4 commit e15708e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
22 changes: 22 additions & 0 deletions .cppcheck.suppressions
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# /home/wuhanqing/tmp/cppcheck-2.12.0/_build/bin/cppcheck -I. --std=c++11 --language=c++ --enable=all --suppressions-list=./cppcheck.suppressions -j4 --output-file=cppcheck.log curvefs/src/

noValidConfiguration
unmatchedSuppression

missingInclude
missingIncludeSystem

unusedFunction

# style
unreadVariable
variableScope
constVariableReference
shadowVariable
shadowFunction
missingOverride
useStlAlgorithm
redundantInitialization

# portability
arithOperationsOnVoidPointer
20 changes: 10 additions & 10 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ jobs:
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: deep5050/cppcheck-action@main
- uses: actions/checkout@v4

- uses: deep5050/[email protected]
with:
enable: all
std: c++11
inconclusive: disable
other_options: "--suppress=syntaxError:* --suppress=danglingTemporaryLifetime:* --suppress=deallocuse:* --suppress=uninitvar:* --suppress=unknownMacro:* --suppress=ctuOneDefinitionRuleViolation:*"
- name: Error check
run: |
if grep -qF 'error: ' cppcheck_report.txt; then
exit 1
fi
output_file: ./cppcheck_report.txt
other_options: "--suppressions-list=./cppcheck.suppressions -j2"

- uses: actions/upload-artifact@v3
if: always()
if: failure()
with:
name: cppcheck
path: cppcheck_report.txt
path: ./cppcheck_report.txt

0 comments on commit e15708e

Please sign in to comment.