aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2023-11-19 16:33:22 +0100
committerMartin Polden <mpolden@mpolden.no>2023-11-19 16:41:53 +0100
commit7730bf27b4f151a815933fefa4da7d638b49043d (patch)
tree85d842787c42d7e53b64a8da8cbaa8f5f16e06d6
parent908d79d5088dafeb5ec6869662e12e9d750220ca (diff)
makefile: clean up
-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 ./...