-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (25 loc) · 844 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
.DEFAULT_GOAL:=help
.PHONY: build
build: clean ## Build binaries
@go build -o mdtoc ./cmd/mdtoc/main.go
.PHONY: clean
clean: ## Clean up binaries
@rm -f mdtoc
.PHONY: cover
cover: test ## Display test coverage report
@go tool cover -func=coverage.txt
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-14s\033[0m %s\n", $$1, $$2}'
.PHONY: lint
lint: ## Lint source code
@golangci-lint run ./...
# This should only be run when significant, breaking changes are made to
# the code generation and updates to the expected markdown cannot be
# made by hand
.PHONY: regen-testdata
regen-testdata: build ## Re-generate testdata markdown results
@bash testdata/regen_testdata.sh
.PHONY: test
test: ## Run unit tests
@go test -v -coverprofile=coverage.txt ./...