Skip to content

Commit

Permalink
cppcheck action
Browse files Browse the repository at this point in the history
Signed-off-by: Hanqing Wu <[email protected]>
  • Loading branch information
wu-hanqing committed Sep 18, 2023
1 parent 874ef62 commit e6bcf53
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 31 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
name: cppcheck-action
on: [push, pull_request]
name: Static Checker

on:
pull_request

jobs:
cppcheck:
name: CppCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: deep5050/cppcheck-action@main
- uses: actions/checkout@v4

- uses: chmorgan/[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: "-j4 --suppressions-list=util/cppcheck/cppcheck.suppressions --error-exitcode=1 -itest -icurvefs/test -inebd/test -inbd/test -icurvefs_python -icurvesnapshot_python -ithirdparties"

- uses: actions/upload-artifact@v3
if: always()
if: failure()
with:
name: cppcheck
path: cppcheck_report.txt
name: cppcheck-error-report
path: ./cppcheck_report.txt
18 changes: 0 additions & 18 deletions .github/workflows/cpplint.yml

This file was deleted.

36 changes: 36 additions & 0 deletions util/cppcheck/cppcheck.suppressions
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
noValidConfiguration
unmatchedSuppression

missingInclude
missingIncludeSystem

unusedFunction

# style
cstyleCast
unreadVariable
variableScope
constVariableReference
shadowVariable
shadowFunction
shadowArgument
missingOverride
useStlAlgorithm
redundantInitialization

# portability
arithOperationsOnVoidPointer

# information
ConfigurationNotChecked

# warning
invalidscanf:src/client/client_common.h

# error
ctuOneDefinitionRuleViolation:curvefs/src/mds/topology/topology_id_generator.h
deallocuse:curvefs/src/metaserver/storage/rocksdb_storage.cpp
deallocuse:nebd/src/part2/file_service.cpp

# performance
uselessCallsSubstr

0 comments on commit e6bcf53

Please sign in to comment.