mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-27 02:45:20 +01:00
make formatcheck: exit with non-zero status code if unformatted files are found
fixup of 7a5883d404
This commit is contained in:
parent
8f4f9338a9
commit
5b30ad01ce
4
Makefile
4
Makefile
@ -212,7 +212,9 @@ GOIMPORTS := goimports -srcdir . -local 'github.com/zrepl/zrepl'
|
|||||||
FINDSRCFILES := find . -type f -name '*.go' -not -path "./vendor/*" -not -name '*.pb.go' -not -name '*_enumer.go'
|
FINDSRCFILES := find . -type f -name '*.go' -not -path "./vendor/*" -not -name '*.pb.go' -not -name '*_enumer.go'
|
||||||
|
|
||||||
formatcheck:
|
formatcheck:
|
||||||
@ $(GOIMPORTS) -l $(shell $(FINDSRCFILES))
|
@# goimports doesn't have a knob to exit with non-zero status code if formatting is needed
|
||||||
|
@# see https://go-review.googlesource.com/c/tools/+/237378
|
||||||
|
@ affectedfiles=$$($(GOIMPORTS) -l $(shell $(FINDSRCFILES)) | tee /dev/stderr | wc -l); test "$$affectedfiles" = 0
|
||||||
|
|
||||||
format:
|
format:
|
||||||
@ $(GOIMPORTS) -w -d $(shell $(FINDSRCFILES))
|
@ $(GOIMPORTS) -w -d $(shell $(FINDSRCFILES))
|
||||||
|
Loading…
Reference in New Issue
Block a user