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

PATH=${PATH}:/opt/pkg/bin export PATH
stat=0
find src -name '*.[ch]' -print | while read file 
do
	uncrustify -c etc/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