diff options
Diffstat (limited to 'etc')
| -rwxr-xr-x | etc/uncrustify_check.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/etc/uncrustify_check.sh b/etc/uncrustify_check.sh new file mode 100755 index 00000000..881fd121 --- /dev/null +++ b/etc/uncrustify_check.sh @@ -0,0 +1,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 |
