Excluding packages from checkstyle check
"emerson cargnin" <[email protected]>
| Newsgroups | gmane.comp.java.audit.checkstyle.user,gmane.comp.version-control.subversion.tortoisesvn.user |
|---|---|
| Message-ID | <[email protected]> |
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
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV