-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
49 lines (37 loc) · 989 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
NAME=turbolift
ARCH=$(shell uname -m)
VERSION=0.0.1
ITERATION := 1
GOLANGCI_VERSION = 1.42.1
BIN_DIR := $(CURDIR)/bin
$(BIN_DIR)/golangci-lint: $(BIN_DIR)/golangci-lint-${GOLANGCI_VERSION}
@ln -sf golangci-lint-${GOLANGCI_VERSION} $(BIN_DIR)/golangci-lint
$(BIN_DIR)/golangci-lint-${GOLANGCI_VERSION}:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | BINARY=golangci-lint bash -s -- v${GOLANGCI_VERSION}
@mv $(BIN_DIR)/golangci-lint $@
mod:
@go mod download
@go mod tidy
.PHONY: mod
lint: $(BIN_DIR)/golangci-lint
@echo "--- lint all the things"
@$(BIN_DIR)/golangci-lint run ./...
.PHONY: lint
fix: $(BIN_DIR)/golangci-lint
@echo "--- Formatting all the things"
@$(BIN_DIR)/golangci-lint run --fix ./...
.PHONY: lint-fix
fmt: fix
build:
@go build .
.PHONY: build
install:
@go install .
.PHONY: install
clean:
@rm -fr ./dist
.PHONY: clean
test: lint
@echo "--- test all the things"
@go test -race -cover ./...
.PHONY: test