mirror of https://github.com/kubernetes/kops.git
Use `git ls-files` to find go files
Otherwise it is hard to ignore files _not_ in git
This commit is contained in:
parent
e63dab8b9c
commit
5c9d9f6f47
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue