-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (21 loc) · 791 Bytes
/
Makefile
File metadata and controls
26 lines (21 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# renovate: datasource=github-tags depName=golangci/golangci-lint
GOLANGCI_VERSION ?= v2.11.4
TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools)
GOLANGCI = $(TOOLS_BIN)/golangci-lint-$(GOLANGCI_VERSION)
$(GOLANGCI):
rm -f $(TOOLS_BIN)/golangci-lint*
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/$(GOLANGCI_VERSION)/install.sh | sh -s -- -b $(TOOLS_BIN) $(GOLANGCI_VERSION)
mv $(TOOLS_BIN)/golangci-lint $(TOOLS_BIN)/golangci-lint-$(GOLANGCI_VERSION)
.PHONY: build
build:
go build -o build/ ./...
validate: validate-lint validate-dirty
validate-lint: $(GOLANGCI)
$(GOLANGCI) run
validate-dirty:
ifneq ($(shell git status --porcelain --untracked-files=no),)
@echo worktree is dirty
@git --no-pager status
@git --no-pager diff
@exit 1
endif