-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (24 loc) · 1.06 KB
/
Makefile
File metadata and controls
35 lines (24 loc) · 1.06 KB
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
BINARY := diffguard
PKG := ./cmd/diffguard
PATHS := internal/,cmd/
.PHONY: all build install test coverage check check-mutation check-fast clean help
all: build
build: ## Build the diffguard binary
go build -o $(BINARY) $(PKG)
install: ## go install the binary to GOBIN
go install $(PKG)
test: ## Run all unit tests
go test ./... -count=1
coverage: ## Generate coverage.out and print the per-package summary
go test ./... -coverprofile=coverage.out -covermode=atomic
@go tool cover -func=coverage.out | tail -1
check-fast: build ## Run the full quality gate with sampled mutation testing (~20%)
./$(BINARY) --mutation-sample-rate 20 --paths $(PATHS) .
check: build ## Run the full quality gate including 100% mutation testing (slow)
./$(BINARY) --paths $(PATHS) .
check-mutation: build ## Only the mutation section, full codebase
./$(BINARY) --paths $(PATHS) --fail-on warn .
clean: ## Remove build artifacts
rm -f $(BINARY) coverage.out
help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-16s %s\n", $$1, $$2}' $(MAKEFILE_LIST)