Use `git ls-files` to find go files

Otherwise it is hard to ignore files _not_ in git
This commit is contained in:
Justin Santa Barbara 2016-12-30 15:29:20 -05:00
parent e63dab8b9c
commit 5c9d9f6f47
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@
GOFMT="gofmt -s -w"
bad_files=$(cat ${KUBE_ROOT}/hack/.packages | grep -v "^k8s.io/kops$" | sed -e s-^k8s.io/kops/-- | xargs -I {} $GOFMT -l {})
bad_files=$(git ls-files "*.go" | grep -v vendor | xargs -I {} $GOFMT -l {})
if [[ -n "${bad_files}" ]]; then
echo "!!! '$GOFMT' needs to be run on the following files: "
echo "${bad_files}"