Update staticcheck version and fix all warnings (#1381)
This commit is contained in:
@@ -14,12 +14,12 @@ then
|
||||
fi
|
||||
|
||||
# Get staticcheck
|
||||
STATICCHECK_VERSION=2019.1.1
|
||||
if [ ! -f $TOOL_DIR/staticcheck ]
|
||||
STATICCHECK_VERSION=2019.2.3
|
||||
if [ ! -f $TOOL_DIR/staticcheck ] || (staticcheck -version | grep -v $STATICCHECK_VERSION)
|
||||
then
|
||||
curl -LO https://github.com/dominikh/go-tools/releases/download/${STATICCHECK_VERSION}/staticcheck_linux_amd64
|
||||
chmod +x staticcheck_linux_amd64
|
||||
mv staticcheck_linux_amd64 $TOOL_DIR/staticcheck
|
||||
curl -LO https://github.com/dominikh/go-tools/releases/download/${STATICCHECK_VERSION}/staticcheck_linux_amd64.tar.gz
|
||||
tar xzvf staticcheck_linux_amd64.tar.gz
|
||||
mv staticcheck/staticcheck $TOOL_DIR/staticcheck
|
||||
fi
|
||||
|
||||
K8SCLI_DIR=$HOME/k8scli
|
||||
|
||||
@@ -6,12 +6,4 @@ set -o pipefail
|
||||
|
||||
ROOT=`realpath $(dirname $0)/..`
|
||||
|
||||
# Currently here only lists the packages that already addressed all warnings for gradual code repair.
|
||||
# That means we don't allow adding new warnings to any of package in list. And eventually, the
|
||||
# list will be replaced by find command.
|
||||
declare -a pkgs=("pkg/builder" "pkg/builder" "pkg/crd" "pkg/logger" "pkg/buildermgr" "pkg/fission-cli" "cmd/fission-cli")
|
||||
|
||||
for pkg in "${pkgs[@]}"
|
||||
do
|
||||
find ${ROOT}/${pkg} -type d |grep -v influxdb | xargs -I@ staticcheck @
|
||||
done
|
||||
go list ./...| grep -v vendor | grep -v "examples" | grep -v "demos" | xargs -I@ staticcheck @
|
||||
|
||||
Reference in New Issue
Block a user