mirror of https://github.com/k3s-io/k3s
30 lines
694 B
Plaintext
30 lines
694 B
Plaintext
|
#!/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)"
|