Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit 33678a8

Browse files
authored
Merge pull request #56 from xinydev/test-presubmit
Return non-zero code when pre-submit check fails
2 parents 42769da + 5a0811d commit 33678a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fmt:
170170
# check-fmt: Checks gofmt/go fmt has been ran. gofmt -l lists files whose formatting differs from gofmt's, so it fails if there are unformatted go code.
171171
check-fmt:
172172
@if [ $(shell gofmt -l ${GOFMT_DIRS} | wc -l ) != 0 ]; then \
173-
echo "Error: there are unformatted go code, please run 'gofmt' before committing" ; \
173+
echo "Error: there are unformatted go code, please run 'gofmt' before committing" && exit 1; \
174174
fi
175175

176176
# Run go vet against code
@@ -183,7 +183,7 @@ generate: controller-gen
183183

184184
check-generate: generate
185185
@if [ $(shell git status --untracked-files=no --porcelain | wc -l ) != 0 ]; then \
186-
echo "Error: generated files are out of sync, please run 'make generate' before committing" ; \
186+
echo "Error: generated files are out of sync, please run 'make generate' before committing" && exit 1; \
187187
fi
188188

189189
# Use the version of controller-gen that's checked into vendor/ (see

0 commit comments

Comments
 (0)