Skip to content

Commit

Permalink
rm clangtidy_checks.txt and it's usage since it's not needed, thanks …
Browse files Browse the repository at this point in the history
…to .clang-tidy file
  • Loading branch information
lbartoletti authored and troopa81 committed Dec 13, 2023
1 parent 4786e59 commit 5b44496
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .docker/docker-qgis-clangtidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions scripts/clang-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
5 changes: 0 additions & 5 deletions tests/code_layout/clangtidy_checks.txt

This file was deleted.

0 comments on commit 5b44496

Please sign in to comment.