aboutsummaryrefslogtreecommitdiff
path: root/etc/uncrustify_check.sh
blob: c51e88802be79f4a9e3fc353b083feb514ba0041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

mydir=`dirname $0`
srcdir=${mydir}/../src
uncrustify --version
PATH=${PATH}:/opt/pkg/bin export PATH
stat=0

find ${srcdir} -name '*.[ch]' -print | while read file 
do
	uncrustify -c "${mydir}/uncrustify.cfg" -lC -f $file | colordiff -u $file -
	if [ $? -ne 0 ]
	then
		stat=1
	fi
done

if [ $stat -ne 0 ]
then
	echo "Format errors detect.  Please fix."
	exit 1
fi
exit 0