-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (21 loc) · 801 Bytes
/
Makefile
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
27
28
ROOT_DIR_RELATIVE := .
include $(ROOT_DIR_RELATIVE)/common.mk
include $(ROOT_DIR_RELATIVE)/plugin-tooling.mk
TOOLS_DIR := tools
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
GOLANGCI_LINT_VERSION := 1.52.2
.PHONY: lint
lint: $(GOLANGCI_LINT) ## Lint the plugin
$(GOLANGCI_LINT) run -v
.PHONY: gomod
gomod: ## Update go module dependencies
go mod tidy
.PHONY: test
test:
go test ./...
$(TOOLS_BIN_DIR):
-mkdir -p $@
$(GOLANGCI_LINT): $(TOOLS_BIN_DIR) ## Install golangci-lint
curl -L https://github.com/golangci/golangci-lint/releases/download/v$(GOLANGCI_LINT_VERSION)/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(GOHOSTOS)-$(GOHOSTARCH).tar.gz | tar -xz -C /tmp/
mv /tmp/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(GOHOSTOS)-$(GOHOSTARCH)/golangci-lint $(@)