diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 584974162..c7f785275 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -103,30 +103,7 @@ test:python: test:cppcheck: stage: test script: - - cppcheck -j $(nproc) - --max-configs=32 - --error-exitcode=1 - --quiet - --inline-suppr - --enable=warning,performance,portability,missingInclude - --std=c++11 - --suppress=noValidConfiguration - -U '_MSC_VER;_WIN32;_M_ARM' - -U '_MSC_VER;_WIN32;_M_AMD64;_M_X64' - -U '_MSC_FULL_VER;_MSC_VER' - -U '_MSC_BUILD;_MSC_VER' - -I include - -I common/include - src/ - lib/ - common/lib/ - common/tests/unit/ - tests/unit/ - fpga/gpu/ - fpga/src/ - fpga/lib/ - fpga/tests/unit/ - | tee cppcheck.log + - ./tools/run-cppcheck.sh | tee cppcheck.log image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} tags: - docker diff --git a/flake.nix b/flake.nix index 325f28202..4a334100e 100644 --- a/flake.nix +++ b/flake.nix @@ -163,6 +163,7 @@ libgit2 pcre reuse + cppcheck ]; in rec { default = full; diff --git a/tools/run-cppcheck.sh b/tools/run-cppcheck.sh new file mode 100755 index 000000000..123821164 --- /dev/null +++ b/tools/run-cppcheck.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +cppcheck -j $(nproc) \ + --max-configs=32 \ + --error-exitcode=1 \ + --quiet \ + --inline-suppr \ + --enable=warning,performance,portability,missingInclude \ + --std=c++11 \ + --suppress=noValidConfiguration \ + -U '_MSC_VER;_WIN32;_M_ARM' \ + -U '_MSC_VER;_WIN32;_M_AMD64;_M_X64' \ + -U '_MSC_FULL_VER;_MSC_VER' \ + -U '_MSC_BUILD;_MSC_VER' \ + -I include \ + -I common/include \ + -I fpga/include \ + -I fpga/gpu/include \ + src/ \ + lib/ \ + common/lib/ \ + common/tests/unit/ \ + tests/unit/ \ + fpga/gpu/src \ + fpga/gpu/lib \ + fpga/src/ \ + fpga/lib/ \ + fpga/tests/unit/