Skip to content
Snippets Groups Projects
Commit fcc8fb57 authored by Tobias Hildebrandt's avatar Tobias Hildebrandt
Browse files

format.sh: only format real source files

ignore files that contain a C++ extension somewhere in their filename
but end with a different extension

Change-Id: Icbac5ace9d6e0eb4f7386751cb565e16045f97f4
parent 52c1f0fc
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ fi
case "${1}" in
--all )
files=$(find src -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\)') || true
files=$(find src -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\)$') || true
echo Formatting all source files...
format_files "$files"
;;
......@@ -79,7 +79,7 @@ case "${1}" in
install_hook "${2}"
;;
* )
files=$(git diff-index --cached --name-only HEAD | grep -iE '\.(cpp|cxx|cc|h|hpp)') || exit_if_no_files
files=$(git diff-index --cached --name-only HEAD | grep -iE '\.(cpp|cxx|cc|h|hpp)$') || exit_if_no_files
echo Formatting committed source files...
format_files "$files"
;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment