2727if hash indent && indent --version | grep -q GNU; then
2828 echo " Checking C files for coding style..."
2929 for f in ` git ls-files ' *.c' ` ; do
30- [ " $verbose " -gt 0 ] 2> /dev/null && echo " checking $f "
30+ [ " $verbose " -gt 0 ] && echo " checking style on $f "
3131 if ! indent $indent_args -st $f | diff -q $f - >& /dev/null; then
3232 echo " File found with formatting issues: $f "
3333 [ " $verbose " -gt 0 ] 2> /dev/null && indent $indent_args -st $f | diff -u $f -
4141
4242if hash grep; then
4343 echo " Checking for dos and whitespace violations..."
44- for f in ` git ls-files ' *.c ' ' *.h ' ' *.asm ' ' *.inc ' ' *.am ' ' *.txt ' ' *.md ' ' *.def ' ' *.ac ' ' *.sh ' ' *.in ' ' Makefile* ' ` ; do
45- [ " $verbose " -gt 0 ] 2> /dev/null && echo " checking $f "
44+ for f in $( git ls-files) ; do
45+ [ " $verbose " -gt 0 ] && echo " checking whitespace on $f "
4646 if grep -q ' [[:space:]]$' $f ; then
4747 echo " File found with trailing whitespace: $f "
4848 rc=1
@@ -54,6 +54,27 @@ if hash grep; then
5454 done
5555fi
5656
57+ echo " Checking source files for permissions..."
58+ while read -r perm _res0 _res1 f; do
59+ [ -z " $f " ] && continue
60+ [ " $verbose " -gt 0 ] && echo " checking permissions on $f "
61+ if [ " $perm " -ne 100644 ]; then
62+ echo " File found with permissions issue ($perm ): $f "
63+ rc=1
64+ fi
65+ done <<< $( git ls-files -s -- ' :(exclude)*.sh' ' :(exclude)*iindent' )
66+
67+ echo " Checking script files for permissions..."
68+ while read -r perm _res0 _res1 f; do
69+ [ -z " $f " ] && continue
70+ [ " $verbose " -gt 0 ] && echo " checking permissions on $f "
71+ if [ " $perm " -ne 100755 ]; then
72+ echo " Script found with permissions issue ($perm ): $f "
73+ rc=1
74+ fi
75+ done <<< $( git ls-files -s ' *.sh' )
76+
77+
5778echo " Checking for signoff in commit message..."
5879if ! git log -n 1 --format=%B | grep -q " ^Signed-off-by:" ; then
5980 echo " Commit not signed off. Please read src/CONTRIBUTING.md"
0 commit comments