From 5b4449602b8545a440d10821bdccbeebbd0c61cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bartoletti?= Date: Wed, 13 Dec 2023 08:59:03 +0100 Subject: [PATCH] rm clangtidy_checks.txt and it's usage since it's not needed, thanks to .clang-tidy file --- .docker/docker-qgis-clangtidy.sh | 3 +-- scripts/clang-tidy.sh | 4 +--- tests/code_layout/clangtidy_checks.txt | 5 ----- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 tests/code_layout/clangtidy_checks.txt diff --git a/.docker/docker-qgis-clangtidy.sh b/.docker/docker-qgis-clangtidy.sh index c060b21709f..b8a71c1fb5d 100755 --- a/.docker/docker-qgis-clangtidy.sh +++ b/.docker/docker-qgis-clangtidy.sh @@ -35,12 +35,11 @@ curl -XGET https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-14.0.6/cl echo "::endgroup::" echo "${bold}Run clang-tidy on modifications...${endbold}" -CLANG_TIDY_CHECKS=$(cat tests/code_layout/clangtidy_checks.txt | grep -ve "^#" | grep -ve "^$" | tr -d '\n') # We need to add build/src/test dir as extra include directories because when clang-tidy tries to process qgstest.h # it has no compile_commands.json instructions to know what are include directories # It manages to figure out for other headers though, I don't get how... -git diff -U0 HEAD^ | python3 clang-tidy-diff.py -p1 -path=${CTEST_BUILD_DIR} -use-color -checks="$CLANG_TIDY_CHECKS" -extra-arg=-I${CTEST_BUILD_DIR}/src/test/ | tee clang-tidy.log +git diff -U0 HEAD^ | python3 clang-tidy-diff.py -p1 -path=${CTEST_BUILD_DIR} -use-color -extra-arg=-I${CTEST_BUILD_DIR}/src/test/ | tee clang-tidy.log echo -e "\e[1;34mTo reproduce locally:" echo -e "\e[1;34m - launch cmake with option -DCMAKE_EXPORT_COMPILE_COMMANDS=ON" diff --git a/scripts/clang-tidy.sh b/scripts/clang-tidy.sh index cfa60bdb44e..ade15ccc03c 100755 --- a/scripts/clang-tidy.sh +++ b/scripts/clang-tidy.sh @@ -52,8 +52,6 @@ while getopts "p:am:" o; do done shift $((OPTIND-1)) -CLANG_TIDY_CHECKS=$(cat ${SOURCE_DIR}/tests/code_layout/clangtidy_checks.txt | grep -ve "^#" | grep -ve "^$" | tr -d '\n') - if [[ ! -f "$BUILD_DIR/compile_commands.json" ]]; then echo "compile_commands.json file is missing, you need to add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON when you run cmake to generate it." exit 1 @@ -80,5 +78,5 @@ set +e for file in $FILES; do - clang-tidy -p=$BUILD_DIR -checks="$CLANG_TIDY_CHECKS" $file + clang-tidy -p=$BUILD_DIR $file done diff --git a/tests/code_layout/clangtidy_checks.txt b/tests/code_layout/clangtidy_checks.txt deleted file mode 100644 index 1d438f51d52..00000000000 --- a/tests/code_layout/clangtidy_checks.txt +++ /dev/null @@ -1,5 +0,0 @@ -bugprone-*, - -# Those we don't want to fix --bugprone-easily-swappable-parameters, --bugprone-virtual-near-miss