test: update lint checker to support packages
This commit is contained in:
@@ -20,9 +20,10 @@ if [ "$COMMITS" != "" ] && [ "$COMMITS" -gt "1" ]; then
|
||||
HACK="yes"
|
||||
fi
|
||||
|
||||
LINT=`golint` # current golint output
|
||||
LINT=`find . -maxdepth 3 -iname '*.go' -not -path './old/*' -not -path './tmp/*' -exec golint {} \;` # current golint output
|
||||
COUNT=`echo -e "$LINT" | wc -l` # number of golint problems in current branch
|
||||
[ "$LINT" = "" ] && echo PASS && exit # everything is "perfect"
|
||||
echo "$LINT" # display the issues
|
||||
|
||||
T=`mktemp --tmpdir -d tmp.XXX`
|
||||
[ "$T" = "" ] && exit 1
|
||||
@@ -46,7 +47,7 @@ while read -r line; do
|
||||
done <<< "$NUMSTAT1" # three < is the secret to putting a variable into read
|
||||
|
||||
git checkout "$PREVIOUS" &>/dev/null # previous commit
|
||||
LINT1=`golint`
|
||||
LINT1=`find . -maxdepth 3 -iname '*.go' -not -path './old/*' -not -path './tmp/*' -exec golint {} \;`
|
||||
COUNT1=`echo -e "$LINT1" | wc -l` # number of golint problems in older branch
|
||||
|
||||
# clean up
|
||||
|
||||
Reference in New Issue
Block a user