From dc837ca8d5c74f14cf14f382e9fcb5388f5a827a Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 28 Dec 2024 11:35:14 +0100 Subject: make: use all as default target and run golangci-lint in each package --- go/Makefile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'go/Makefile') diff --git a/go/Makefile b/go/Makefile index 15343636..8442dfa9 100644 --- a/go/Makefile +++ b/go/Makefile @@ -6,15 +6,14 @@ WASM := client/client.wasm webtools/webtools.wasm GOFMT := gofumpt -l -w . +.PHONY: all fmt test check $(OBJS) $(WASM) +all: $(OBJS) $(WASM) + .PHONY: client server dummy-ui client: client/client server: server/server dummy-ui: dummy-ui/dummy-ui -.PHONY: all fmt test check $(OBJS) $(WASM) -all: $(OBJS) $(WASM) - - $(OBJS): @echo Building $(@F) @pushd $(@D) >/dev/null && go build && popd >/dev/null @@ -41,4 +40,13 @@ test: exit "$$STATUS" check: - golangci-lint run --skip-dirs webtools + @STATUS=0; \ + for package in $(PACKAGES); do \ + if pushd "$$package" >/dev/null; then \ + golangci-lint run; \ + status="$$?"; \ + if [ "$$status" -ne 0 ]; then STATUS="$$status"; fi; \ + popd >/dev/null; \ + fi; \ + done; \ + exit "$$STATUS" -- cgit v1.2.3