From 88b700da9659e5d2ef78ac3227e1d308e1098cdd Mon Sep 17 00:00:00 2001 From: Martin Killenberg <martin.killenberg@desy.de> Date: Thu, 10 Oct 2024 16:13:16 +0200 Subject: [PATCH] fix(project-template): find pattern in coding style check --- cmake/check-coding-style.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmake/check-coding-style.sh b/cmake/check-coding-style.sh index ad99511..ec6e947 100755 --- a/cmake/check-coding-style.sh +++ b/cmake/check-coding-style.sh @@ -12,7 +12,7 @@ exclude_pattern="$exclude_path/*" # check clang-format formatting if which clang-format-14 > /dev/null; then - find $mypath \( -name *.cc -o -name *.cpp -o -name *.h \) -not -path "$exclude_pattern" -exec clang-format-14 --output-replacements-xml \{\} \; | grep "^<replacement " > /dev/null + find $mypath \( -name \*.cc -o -name \*.cpp -o -name \*.h \) -not -path "$exclude_pattern" -exec clang-format-14 --output-replacements-xml \{\} \; | grep "^<replacement " > /dev/null if [ $? -ne 1 ]; then echo 1 > "${ERRFILE}" echo "Code formatting incorrect!" @@ -37,7 +37,7 @@ checkCopyrightComment() { fi } export -f checkCopyrightComment -find $mypath \( -name *.cc -o -name *.cpp -o -name *.h \) -not -path "$exclude_pattern" -exec bash -c 'checkCopyrightComment {}' \; +find $mypath \( -name \*.cc -o -name \*.cpp -o -name \*.h \) -not -path "$exclude_pattern" -exec bash -c 'checkCopyrightComment {}' \; # check all header files for "#pragma once" in 3rd line checkPramgaOnce() { @@ -47,10 +47,9 @@ checkPramgaOnce() { fi } export -f checkPramgaOnce -find $mypath -name *.h -not -path "$exclude_pattern" -exec bash -c 'checkPramgaOnce {}' \; +find $mypath -name \*.h -not -path "$exclude_pattern" -exec bash -c 'checkPramgaOnce {}' \; ERROR=`cat "${ERRFILE}"` rm -f "${ERRFILE}" exit ${ERROR} - -- GitLab