Skip to content

Commit

Permalink
Move some cppcheck rules to cppcheck addon instead (#2519)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 authored Dec 19, 2023
1 parent 1f2792a commit a26a796
Show file tree
Hide file tree
Showing 27 changed files with 670 additions and 526 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ jobs:
uses: actions/cache/restore@v3
with:
path: cppcheck-cache
key: cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}-${{ github.ref }}
restore-keys: cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}-
key: cppcheck-cache-1-${{ hashFiles('tools/cppcheck/rules.xml', 'tools/cppcheck/migraphx.py', 'CMakeLists.txt') }}-${{ github.ref }}
restore-keys: cppcheck-cache-1-${{ hashFiles('tools/cppcheck/rules.xml', 'tools/cppcheck/migraphx.py', 'CMakeLists.txt') }}-

- name: Cppcheck
shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU bash < {0}"
Expand Down
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,14 @@ rocm_enable_cppcheck(
ctuOneDefinitionRuleViolation:*test/*
useSmartPointer:*src/api/api.cpp
useSmartPointer:*make_shared_array.hpp
migraphx-RedundantLocalVariable:*src/api/api.cpp
migraphx-UseSmartPointer:*src/api/api.cpp
FORCE
INCONCLUSIVE
RULE_FILE
${CMAKE_CURRENT_SOURCE_DIR}/cppcheck.rules
${CMAKE_CURRENT_SOURCE_DIR}/tools/cppcheck/rules.xml
ADDONS
${CMAKE_CURRENT_SOURCE_DIR}/tools/cppcheck/migraphx.py
SOURCES
examples/
src/
Expand All @@ -278,12 +282,18 @@ rocm_enable_cppcheck(
${CMAKE_CURRENT_SOURCE_DIR}/test/include
DEFINE
MIGRAPHX_MLIR=1
MIGRAPHX_HAS_EXECUTORS=0
CPPCHECK=1
BUILD_DEV=
__device__=
__host__=
__global__=
UNDEFINE
MIGRAPHX_USE_CLANG_TIDY
DOXYGEN
HAS_HALF_V1
TYPE_ERASED_DECLARATION
NDEBUG
)

include(ROCMCreatePackage)
Expand Down
Loading

0 comments on commit a26a796

Please sign in to comment.