From 41598454013a27fa529d026a46e6027a5de9216e Mon Sep 17 00:00:00 2001 From: Adrien Guatto Date: Tue, 29 Jun 2010 11:21:31 +0200 Subject: [PATCH] Added manual style checking script. --- tools/checkstyle.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tools/checkstyle.sh diff --git a/tools/checkstyle.sh b/tools/checkstyle.sh new file mode 100755 index 0000000..c1aac22 --- /dev/null +++ b/tools/checkstyle.sh @@ -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