-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 715 Bytes
/
Makefile
File metadata and controls
39 lines (29 loc) · 715 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
27
28
29
30
31
32
33
34
35
36
37
38
39
.PHONY: build install run clean test lint fmt check
BINARY := rig
BIN_DIR := ./bin
## build: compile the binary
build:
go build -o $(BIN_DIR)/$(BINARY) .
## install: install to $GOPATH/bin
install:
go install .
## run: run without building (pass args via ARGS=)
run:
go run . $(ARGS)
## test: run all tests
test:
go test ./...
## lint: run golangci-lint
lint:
golangci-lint run ./...
## fmt: format and fix lint issues in-place
fmt:
golangci-lint run --fix ./...
## check: fmt + lint + test (use before committing)
check: fmt lint test
## clean: remove build artifacts
clean:
rm -rf $(BIN_DIR) dist
## help: show this help
help:
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## //' | column -t -s ':'