test: add "unused_pass"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
release-3.4
Gyuho Lee 2018-05-09 11:25:15 -07:00
parent 054cdcd127
commit 775e9d5ba6
1 changed files with 13 additions and 0 deletions

13
test
View File

@ -479,6 +479,18 @@ function unused_pass {
fi
}
function unparam_pass {
if which unparam >/dev/null; then
unparamResult=$(unparam "${STATIC_ANALYSIS_PATHS[@]}" 2>&1 || true)
if [ -n "${unparamResult}" ]; then
echo -e "unparam checking failed:\\n${unparamResult}"
exit 255
fi
else
echo "Skipping unparam..."
fi
}
function staticcheck_pass {
if which staticcheck >/dev/null; then
staticcheckResult=$(staticcheck "${STATIC_ANALYSIS_PATHS[@]}" 2>&1 || true)
@ -601,6 +613,7 @@ function fmt_pass {
govet_shadow \
gosimple \
unused \
unparam \
staticcheck \
unconvert \
ineffassign \