Upgrade to golangci-lint

This commit is contained in:
Erik Wilson
2019-03-24 21:50:02 -07:00
parent 4463408819
commit 1f82d834e7
4 changed files with 34 additions and 38 deletions

View File

@@ -3,34 +3,21 @@ set -e
cd $(dirname $0)/..
if ! command -v golangci-lint; then
echo Skipping validation: no golangci-lint available
exit
fi
echo Running validation
PACKAGES="$(go list ./...)"
if [ ! -e build/data ];then
mkdir -p build/data
fi
echo Running: go generate
go generate
echo Running: go vet
go vet ${PACKAGES}
echo Running: gometalinter
for i in ${PACKAGES}; do
if [ -n "$(gometalinter $i | \
grep -v 'pkg/data/zz_generated_bindata.go' | \
grep -v 'should have comment.*or be unexported' | \
grep -v 'cli/cmd.*don.t use underscores in Go name' | \
grep -v 'cli/cmd.*should be DNS' | \
tee /dev/stderr)" ]; then
failed=true
fi
done
test -z "$failed"
echo Running: go fmt
test -z "$(go fmt ${PACKAGES} | \
grep -v 'pkg/data/zz_generated_bindata.go' | \
tee /dev/stderr)"
echo Running: golangci-lint
golangci-lint run
. ./scripts/version.sh