aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 0eb571c..674b626 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ XGOARCH := amd64
XGOOS := linux
XBIN := $(XGOOS)_$(XGOARCH)/journal
-all: lint test install
+all: checkfmt vet test install
test:
go test ./...
@@ -10,10 +10,11 @@ test:
vet:
go vet ./...
-fmt:
- bash -c "diff --line-format='%L' <(echo -n) <(gofmt -d -s .)"
+checkfmt:
+ @sh -c "test -z $$(gofmt -l .)" || { echo "one or more files need to be formatted: try make fmt to fix this automatically"; exit 1; }
-lint: fmt vet
+fmt:
+ gofmt -w .
install:
go install ./...