diff --git a/cmake/check-coding-style.sh b/cmake/check-coding-style.sh index ad99511c0abad35afc3f36c621e2514cdedd9742..ec6e9477f76960e6c1d967e62c54f3315e419da6 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} -