-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (43 loc) · 1.36 KB
/
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
49
50
51
52
53
54
55
56
57
GO_FILES=$(shell find pkg -name '*.go')
################################################################################
# Demo
.PHONY: demo-clocks
demo-clocks: git-hooks
@go run ./cmd/yakdash/main.go -c examples/clocks.yaml
.PHONY: demo-command
demo-command: git-hooks
@go run ./cmd/yakdash/main.go -c examples/command.yaml
.PHONY: demo-alignment
demo-alignment: git-hooks
@go run ./cmd/yakdash/main.go -c examples/alignment.yaml
################################################################################
# Build
bin/yakdash: git-hooks $(GO_FILES)
go build -o bin/yakdash ./cmd/yakdash
################################################################################
# Test
.PHONY: test
test: git-hooks
@go test ./...
.PHONY: test-coverage
test-coverage: coverage.out
@go tool cover -html=coverage.out
coverage.out: $(GO_FILES)
@go test -coverprofile=coverage.out ./pkg/...
################################################################################
# Lint / Format
.PHONY: lint
lint: git-hooks
golangci-lint run ./...
.PHONY: fmt
fmt: node_modules git-hooks
go fmt ./...
npx prettier --write .
node_modules: package.json package-lock.json
@npm install
@touch node_modules
.PHONY:
git-hooks: .git/hooks/pre-commit
.git/hooks/pre-commit: ./.evertras/pre-commit.sh
@cp ./.evertras/pre-commit.sh ./.git/hooks/pre-commit
@chmod +x ./.git/hooks/pre-commit