Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (37 loc) · 1.53 KB
/
Copy pathMakefile
File metadata and controls
48 lines (37 loc) · 1.53 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
36
37
38
39
40
41
42
43
44
45
46
47
48
GOA ?= $(HOME)/go/bin/goa
DESIGN := github.com/hatyibei/shingan/design
BIN_DIR := /tmp
.PHONY: gen test build-all bench bench-rules dogfood gen-cli sample-% check-reason lint
## gen: regenerate goa HTTP handlers and OpenAPI spec from design/design.go
gen:
$(GOA) gen $(DESIGN)
## test: run all tests with race detector
test:
go test -race ./...
## check-reason: fail when a domain.Finding literal in domain/rules omits ConfidenceReason (ADR-008)
## go/analysis vet tool; also accepts the field set via assignment / factory.
check-reason:
@go run ./tools/cmd/check-confidence-reason ./domain/rules/...
## lint: run go vet and the ConfidenceReason check together
lint: check-reason
go vet ./...
## build-all: build CLI and API binaries
build-all:
go build -o $(BIN_DIR)/shingan ./cmd/shingan
go build -o $(BIN_DIR)/shingan-api ./cmd/api
## gen-cli: build shingan-gen sample generator CLI
gen-cli:
go build -o $(BIN_DIR)/shingan-gen ./cmd/shingan-gen
## sample-%: generate a sample workflow (e.g. make sample-buggy, make sample-clean)
sample-%: gen-cli
@$(BIN_DIR)/shingan-gen --pattern $* --seed 42
## bench: run all benchmarks (excludes normal tests)
bench:
go test -bench=. -benchmem -run=^$$ ./...
## bench-rules: run only domain/rules benchmarks
bench-rules:
go test -bench=. -benchmem -run=^$$ ./domain/rules/...
## dogfood: clone the corpus + run shingan on each repo, write reports to /tmp/shingan-dogfood
## backs the "Real-World Accuracy" table in docs/benchmarks.md.
dogfood:
@./scripts/dogfood_sweep.sh