Merge branch 'cgal/releases/CGAL-4.14-branch'
whitespace+tab removal, merged with option -Xignore-all-space
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! git diff --exit-code > /dev/null || ! git diff --staged --exit-code > /dev/null ; then
|
||||
echo 'Your working directory contains local modifications!' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f Installation/include/CGAL/version.h ]; then
|
||||
echo "This script should be run at the root of a CGAL branch" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# replace tabs by two spaces in AABB-tree and Minkowski_sum_2 packages
|
||||
find AABB_tree -name '*.h' -o -name '*.cpp' -o -name '*.txt' | xargs sed -i -E 's/\t/ /g'
|
||||
find Minkowski_sum_2 -name '*.h' -o -name '*.cpp' -o -name '*.txt' | xargs sed -i -E 's/\t/ /g'
|
||||
|
||||
#replace tabs by 8 spaces for all other packages
|
||||
find . -name '*.h' -o -name '*.cpp' -o -name '*.hpp' -o -name '*.tcc' -o -name '*.txt' | xargs sed -i -E 's/\t/ /g'
|
||||
|
||||
#remove trailing whitespace
|
||||
find . -name '*.h' -o -name '*.cpp' -o -name '*.hpp' -o -name '*.tcc' -o -name '*.txt' | xargs sed -i -E 's/\s+$//'
|
||||
@@ -162,6 +162,24 @@ if [ -n "${txt_not_utf8}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#check no file contains tab characters
|
||||
echo '.. Checking if tab character is used...'
|
||||
file_with_tabs=$(git ls-files --stage | egrep '\.txt|\.h$|\.cpp|\.hpp' | awk '{print $4}' | xargs grep -P -l '\t')
|
||||
if [ -n "${file_with_tabs}" ]; then
|
||||
echo "The following files have tabs:"
|
||||
echo ${file_with_tabs}
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#check no file contains trailing whitespaces characters
|
||||
echo '.. Look for trailing whitespaces...'
|
||||
files_with_trailingws=$(git ls-files --stage | egrep '\.txt|\.h$|\.cpp|\.hpp' | awk '{print $4}' | xargs grep -P -l '\s+$')
|
||||
if [ -n "${files_with_trailingws}" ]; then
|
||||
echo "The following files have trailing whitespaces:"
|
||||
echo ${files_with_trailingws}
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#check all headers in documentation actually exist
|
||||
echo '.. Checking if all documentation headers exist'
|
||||
not_existing_headers=$(bash ./Scripts/developer_scripts/check_headers.sh $PWD)
|
||||
|
||||
Reference in New Issue
Block a user