Skip to content
Snippets Groups Projects
Commit 88b700da authored by Martin Killenberg's avatar Martin Killenberg Committed by Martin Killenberg
Browse files

fix(project-template): find pattern in coding style check

parent 71759103
No related branches found
Tags 08.00.01
1 merge request!15fix(project-template): find pattern in coding style check
......@@ -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}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment