From 39b8d9ac4b548d27c7745b1bd018efdf7338391f Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sun, 3 May 2026 10:22:30 +0200 Subject: [PATCH] Add fmt command to makefile --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6ab671d..7872cb2 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build fmt vet check githook install uninstall +.PHONY: build fmt fmtcheck vet check githook install uninstall PKG := github.com/Riyyi/declpac BIN := declpac @@ -15,6 +15,9 @@ build: go build -o $(BUILD) ./cmd/declpac fmt: + @gofmt -w cmd pkg + +fmtcheck: @if [ -z "$(STAGED_GO)" ]; then exit 0; fi; \ unformatted=$$(gofmt -l $(STAGED_GO)); \ if [ -n "$$unformatted" ]; then \ @@ -26,7 +29,7 @@ vet: @if [ -z "$(STAGED_GO)" ]; then exit 0; fi; \ go vet $(STAGED_PKGS) -check: fmt vet +check: fmtcheck vet githook: @mkdir -p .git/hooks