-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (33 loc) · 954 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
## help: Show makefile commands
.PHONY: help
help: Makefile
@echo "---- Project: Imputes/fdlr ----"
@echo " Usage: make COMMAND"
@echo
@echo " Management Commands:"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
FILES_TO_FORMAT ?= $(shell find . -name '*.go')
GOFLAGS ?= -trimpath
## build: Build project
.PHONY: build
build:
@go build $(GOFLAGS) -o ./bin ./cmd/fdlr
## deps: Ensures fresh go.mod and go.sum
.PHONY: deps
deps:
@go mod tidy
@go mod verify
## lint: Run golangci-lint check
.PHONY: lint
lint:
@if [ ! -f ./bin/golangci-lint ]; then \
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s $(GOLANGCI_LINT_VERSION); \
fi;
@echo "golangci-lint checking..."
@./bin/golangci-lint run --deadline=30m --disable=govet --disable=ineffassign --disable=unused
## format: Formats Go code
.PHONY: format
format:
@echo "formatting code..."
@gofmt -s -e -w $(FILES_TO_FORMAT)