diff --git a/.cppcheck.suppressions b/.cppcheck.suppressions new file mode 100644 index 0000000000..dc2c22e800 --- /dev/null +++ b/.cppcheck.suppressions @@ -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 diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index 5f283241a4..4c7c7fbcae 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -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/cppcheck-action@v3.0 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