mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 08:20:59 +00:00
Add travis CICD coverage.
Also, rename "kexpand" to "kinflate" to ease pronunciation.
This commit is contained in:
37
pre-commit.sh
Executable file
37
pre-commit.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$failIt" ]; then
|
||||
echo "Expecting failIt to be empty."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tmp=$(gofmt -s -d -l . 2>&1 )
|
||||
if [ -n "$tmp" ]; then
|
||||
printf >&2 'gofmt failed for:\n%s\n' "$tmp"
|
||||
failIt=1
|
||||
fi
|
||||
|
||||
tmp=$(goimports -l .)
|
||||
if [ -n "$tmp" ]; then
|
||||
printf >&2 'goimports failed for:\n%s\n' "$tmp"
|
||||
failIt=1
|
||||
fi
|
||||
|
||||
tmp=$(go vet -all ./... 2>&1)
|
||||
if [ -n "$tmp" ]; then
|
||||
printf >&2 'govet failed for:\n%s\n' "$tmp"
|
||||
failIt=1
|
||||
fi
|
||||
|
||||
tmp=$(golint ./...)
|
||||
if [ -n "$tmp" ]; then
|
||||
printf >&2 'golint failed for:\n%s\n' "$tmp"
|
||||
failIt=1
|
||||
fi
|
||||
|
||||
if [ -n "$failIt" ]; then
|
||||
unset failIt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
go test -v ./...
|
||||
Reference in New Issue
Block a user