Lightweight Kubernetes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
694 B

6 years ago
#!/bin/bash
set -e
cd $(dirname $0)/..
echo Running validation
if grep -r '^[[:space:]]*\[\[.*]][[:space:]]*$' tests; then
echo "Add \"|| false\" to bats tests in any place you use [[ ... ]]"
exit 1
fi
PACKAGES="$(go list ./...)"
echo Running: go vet
go vet ${PACKAGES}
echo Running: gometalinter
for i in ${PACKAGES}; do
if [ -n "$(gometalinter $i | \
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} | tee /dev/stderr)"