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