diff options
author | Stan Hu <stanhu@gmail.com> | 2021-07-26 16:21:10 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2021-07-26 16:21:10 -0700 |
commit | 0997266fc03b0851e4ef52d25dbe8b44bdba7de7 (patch) | |
tree | 356c942bebe9e5cd9510c70574821cc81915a17f | |
parent | 1eadd3a61f3955354b4041fd284ba50e2a17864a (diff) | |
download | gitlab-shell-0997266fc03b0851e4ef52d25dbe8b44bdba7de7.tar.gz |
Make gofmt check fail if there are any matching files
gofmt doesn't return an exit code 1 if there are matching files:
https://github.com/golang/go/issues/24230
To fix this, use the same trick we use in Workhorse to parse output.
Also add a `make fmt` step to format all the code properly.
-rw-r--r-- | Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -13,7 +13,10 @@ validate: verify test verify: verify_golang verify_golang: - gofmt -s -l $(GO_SOURCES) + gofmt -s -l $(GO_SOURCES) | awk '{ print } END { if (NR > 0) { print "Please run make fmt"; exit 1 } }' + +fmt: + gofmt -w -s $(GO_SOURCES) test: test_ruby test_golang |