File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- GOCMD = go
1+ GOCMD = go
22GOTEST = $(GOCMD ) test
33
44# renovate: datasource=github-tags depName=golangci/golangci-lint
55GOLANGCI_VERSION ?= v2.9.0
66
7- TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools)
8- GOLANGCI = $(TOOLS_BIN ) /golangci-lint-$(GOLANGCI_VERSION )
7+ ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST ) ) ) )
8+ TOOLS_BIN := $(shell mkdir -p $(ROOT ) build/tools && realpath $(ROOT ) build/tools)
9+ GOLANGCI = $(TOOLS_BIN ) /golangci-lint-$(GOLANGCI_VERSION )
910$(GOLANGCI ) :
1011 rm -f $(TOOLS_BIN ) /golangci-lint*
1112 curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/$(GOLANGCI_VERSION ) /install.sh | sh -s -- -b $(TOOLS_BIN ) $(GOLANGCI_VERSION )
1213 mv $(TOOLS_BIN ) /golangci-lint $(TOOLS_BIN ) /golangci-lint-$(GOLANGCI_VERSION )
1314
15+ MODULES := $(shell find $(ROOT ) -mindepth 2 -name "go.mod" -exec dirname {} \; | sort)
16+
1417test :
15- $(GOTEST ) -race ./...
18+ @for dir in $(MODULES ) ; do \
19+ (cd $$ dir && $( GOTEST) -race ./...) || exit 1; \
20+ done
1621
1722validate : validate-lint validate-dirty
1823
1924validate-lint : $(GOLANGCI )
20- $(GOLANGCI ) run
25+ @for dir in $(MODULES ) ; do \
26+ (cd $$ dir && $( GOLANGCI) run) || exit 1; \
27+ done
2128
2229validate-dirty :
2330ifneq ($(shell git status --porcelain --untracked-files=no) ,)
You can’t perform that action at this time.
0 commit comments