From 7730bf27b4f151a815933fefa4da7d638b49043d Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Sun, 19 Nov 2023 16:33:22 +0100 Subject: makefile: clean up --- Makefile | 9 +++++---- 1 file 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 ./... -- cgit v1.2.3