From ae0e96eba30d075bab0a0ca0da40ae6d1b62ab37 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 20 Feb 2026 03:17:38 -0800 Subject: [PATCH] refactor: split check into check-fmt, lint, test targets make check now depends on check-fmt, lint, and test as prerequisites, each runnable independently. --- Makefile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 34e4102..53f4fb3 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ GOLDFLAGS += -X main.Version=$(VERSION) GOLDFLAGS += -X main.Gitrev=$(GITREV_BUILD) GOFLAGS := -ldflags "$(GOLDFLAGS)" -.PHONY: docker default run ci test fixme +.PHONY: docker default run ci test fixme check check-fmt lint default: fmt test @@ -51,9 +51,8 @@ fmt: mfer/mf.pb.go -prettier -w *.json -prettier -w *.md -lint: - golangci-lint run - sh -c 'test -z "$$(gofmt -l .)"' +lint: mfer/mf.pb.go + golangci-lint run ./... docker: sneak-mfer.$(ARCH).tzst.dockerimage @@ -80,11 +79,10 @@ modcache.tzst: go.mod go.sum cd $(shell go env GOMODCACHE) && tar -c . | pv | zstdmt -19 > $(PWD)/$@.tmp mv $@.tmp $@ -# Run all checks (formatting, linting, tests) without modifying files -check: +# Individual check targets +check-fmt: @echo "==> Checking formatting..." @test -z "$$(gofmt -l .)" || (echo "Files not formatted:" && gofmt -l . && exit 1) - @echo "==> Running linter..." - golangci-lint run ./... - @echo "==> Running tests..." - go test -race -timeout 30s ./... + +# Run all checks (formatting, linting, tests) without modifying files +check: check-fmt lint test