2020-12-08 15:23:35 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-12-30 15:26:25 +00:00
|
|
|
verbose="${VERBOSE:-0}"
|
|
|
|
|
2021-01-15 17:30:48 +00:00
|
|
|
if [ "$verbose" -gt '1' ]
|
2020-12-30 15:26:25 +00:00
|
|
|
then
|
|
|
|
set -x
|
2021-01-15 17:30:48 +00:00
|
|
|
readonly v_flags='-v'
|
|
|
|
readonly x_flags='-x'
|
|
|
|
elif [ "$verbose" -gt '0' ]
|
|
|
|
then
|
|
|
|
set -x
|
|
|
|
readonly v_flags='-v'
|
|
|
|
readonly x_flags=''
|
|
|
|
else
|
|
|
|
set +x
|
|
|
|
readonly v_flags=''
|
|
|
|
readonly x_flags=''
|
2020-12-30 15:26:25 +00:00
|
|
|
fi
|
|
|
|
|
2020-12-08 15:23:35 +00:00
|
|
|
set -e -f -u
|
|
|
|
|
2021-01-15 17:30:48 +00:00
|
|
|
go="${GO:-go}"
|
|
|
|
|
2020-12-08 15:23:35 +00:00
|
|
|
# TODO(a.garipov): Add goconst?
|
|
|
|
|
2021-01-15 17:30:48 +00:00
|
|
|
# Reset GOARCH and GOOS to make sure we install the tools for the native
|
|
|
|
# architecture even when we're cross-compiling the main binary, and also
|
|
|
|
# to prevent the "cannot install cross-compiled binaries when GOBIN is
|
|
|
|
# set" error.
|
|
|
|
env\
|
|
|
|
GOARCH=""\
|
|
|
|
GOOS=""\
|
|
|
|
GOBIN="${PWD}/bin"\
|
|
|
|
"$go" install --modfile=./internal/tools/go.mod\
|
|
|
|
$v_flags $x_flags\
|
2020-12-08 15:23:35 +00:00
|
|
|
github.com/fzipp/gocyclo/cmd/gocyclo\
|
|
|
|
github.com/golangci/misspell/cmd/misspell\
|
|
|
|
github.com/gordonklaus/ineffassign\
|
|
|
|
github.com/kisielk/errcheck\
|
|
|
|
github.com/kyoh86/looppointer/cmd/looppointer\
|
|
|
|
github.com/securego/gosec/v2/cmd/gosec\
|
|
|
|
golang.org/x/lint/golint\
|
|
|
|
golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness\
|
|
|
|
golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow\
|
|
|
|
honnef.co/go/tools/cmd/staticcheck\
|
|
|
|
mvdan.cc/gofumpt\
|
|
|
|
mvdan.cc/unparam\
|
|
|
|
;
|