diff --git a/hack/make/.validate b/hack/make/.validate index 09439fd2..3c59d16d 100644 --- a/hack/make/.validate +++ b/hack/make/.validate @@ -21,9 +21,7 @@ if [ -z "$VALIDATE_UPSTREAM" ]; then VALIDATE_COMMIT_DIFF="$VALIDATE_UPSTREAM...$VALIDATE_HEAD" validate_diff() { - if [ "$VALIDATE_UPSTREAM" != "$VALIDATE_HEAD" ]; then - git diff "$VALIDATE_COMMIT_DIFF" "$@" - fi + git diff "$VALIDATE_UPSTREAM" "$@" } validate_log() { if [ "$VALIDATE_UPSTREAM" != "$VALIDATE_HEAD" ]; then diff --git a/hack/make/validate-gofmt b/hack/make/validate-gofmt index 8fc88cc5..0f973f92 100755 --- a/hack/make/validate-gofmt +++ b/hack/make/validate-gofmt @@ -8,8 +8,7 @@ unset IFS badFiles=() for f in "${files[@]}"; do - # we use "git show" here to validate that what's committed is formatted - if [ "$(git show "$VALIDATE_HEAD:$f" | gofmt -s -l)" ]; then + if [ "$(gofmt -s -l < $f)" ]; then badFiles+=( "$f" ) fi done diff --git a/hack/make/validate-lint b/hack/make/validate-lint index f8cb9c9f..3674d723 100755 --- a/hack/make/validate-lint +++ b/hack/make/validate-lint @@ -11,7 +11,6 @@ unset IFS errors=() for f in "${files[@]}"; do - # we use "git show" here to validate that what's committed passes go lint failedLint=$(golint "$f") if [ "$failedLint" ]; then errors+=( "$failedLint" ) diff --git a/hack/make/validate-vet b/hack/make/validate-vet index e88f7549..39f4a2c1 100755 --- a/hack/make/validate-vet +++ b/hack/make/validate-vet @@ -8,7 +8,6 @@ unset IFS errors=() for f in "${files[@]}"; do - # we use "git show" here to validate that what's committed passes go vet failedVet=$(go vet "$f") if [ "$failedVet" ]; then errors+=( "$failedVet" )