k3s/scripts/validate

29 lines
725 B
Plaintext
Raw Normal View History

2019-01-01 08:23:01 +00:00
#!/bin/bash
set -e
cd $(dirname $0)/..
echo Running validation
PACKAGES="$(go list ./...)"
2019-01-09 16:54:15 +00:00
#echo Running: go vet
#go vet ${PACKAGES}
2019-01-01 08:23:01 +00:00
echo Running: gometalinter
for i in ${PACKAGES}; do
if [ -n "$(gometalinter $i | \
2019-01-09 16:54:15 +00:00
grep -v 'pkg/data/zz_generated_bindata.go' | \
2019-01-01 08:23:01 +00:00
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
2019-01-09 16:54:15 +00:00
test -z "$(go fmt ${PACKAGES} | \
grep -v 'pkg/data/zz_generated_bindata.go' | \
2019-01-22 21:14:58 +00:00
grep -v 'pkg/deploy/zz_generated_bindata.go' | \
2019-01-09 16:54:15 +00:00
tee /dev/stderr)"