Browse Source

test: add "unused_pass"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee 7 years ago
parent
commit
775e9d5ba6
1 changed files with 13 additions and 0 deletions
  1. 13 0
      test

+ 13 - 0
test

@@ -479,6 +479,18 @@ function unused_pass {
 	fi
 	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 {
 function staticcheck_pass {
 	if which staticcheck >/dev/null; then
 	if which staticcheck >/dev/null; then
 		staticcheckResult=$(staticcheck "${STATIC_ANALYSIS_PATHS[@]}" 2>&1 || true)
 		staticcheckResult=$(staticcheck "${STATIC_ANALYSIS_PATHS[@]}" 2>&1 || true)
@@ -601,6 +613,7 @@ function fmt_pass {
 			govet_shadow \
 			govet_shadow \
 			gosimple \
 			gosimple \
 			unused \
 			unused \
+			unparam \
 			staticcheck \
 			staticcheck \
 			unconvert \
 			unconvert \
 			ineffassign \
 			ineffassign \