Added manual style checking script.

This commit is contained in:
Adrien Guatto 2010-06-29 11:21:31 +02:00
parent f35bf95458
commit 4159845401

24
tools/checkstyle.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh
[ -f $1 ] || $(echo "File $1 does not exists." && exit 1)
bad=0
if [ `wc -L $1 | awk '{ print $1 }'` -gt 80 ]; then
echo "File \"$1\" has lines with more than 80 columns."
bad=1
fi
grep -P '\t' $1 > /dev/null
if [ $? -eq 0 ]; then
echo "File \"$1\" has tabulations in it."
bad=1
fi
grep -P ' +$' $1 > /dev/null
if [ $? -eq 0 ]; then
echo "File \"$1\" has trailing whitespace."
bad=1
fi
exit $bad