[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Excluding packages from checkstyle check

From: emerson cargnin <echofloripa.yell_at_gmail.com>
Date: 2007-02-28 13:17:14 CET

Hi there, I'm using a subversion pre-commit hook and checkstyle to
check style during commit.

Does anyone know how can i filter out some packages to not be checked?
I presume i need to change the line:
FILE=`echo $LINE | egrep \\.java$`

I use the following script:

# Run checkstyle on java files
CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | grep -v "^D" |\
        awk '{print $2}'`
mkdir -p $TMPDIR
X=0
for LINE in $CHANGED ; do
   FILE=`echo $LINE | egrep \\.java$`
   if [ -n "$FILE" ] ; then
       $SVNLOOK cat $REPOS --transaction $TXN $FILE > $TMPDIR/tmpfile.java
       $JAVA -jar $CHECKSTYLE -c $CHECKSTYLE_CONFIG $TMPDIR/tmpfile.java \
> $TMPDIR/tmpfile.checkstyle
       X=$(($X + $?))
       cat $TMPDIR/tmpfile.checkstyle |\
           grep -v "^Starting audit...$\|^Audit done.$" |\
           sed -e "s@$TMPDIR/tmpfile.java@$FILE@" \
>> $REPORT
       fi
done
if [ $X -ne 0 ] ; then
   cat $REPORT > /dev/stderr
   rm -Rf $TMPDIR
   exit 1
fi
rm -Rf $TMPDIR

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Feb 28 13:17:47 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.