-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (42 loc) · 1.8 KB
/
Makefile
File metadata and controls
54 lines (42 loc) · 1.8 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
49
50
51
52
53
54
.PHONY: all test lint vulncheck build build-quick clean snapshot-test update-snapshot snapshot-diff snapshot-review help
all: test lint build ## Run test, lint, and build (full CI check)
test: ## Run all tests with race detector
go test -v -race -count=1 ./...
lint: ## Run vet, golangci-lint, and staticcheck
go vet ./...
golangci-lint run ./...
staticcheck ./...
vulncheck: ## Run govulncheck for known vulnerabilities
govulncheck ./...
build: ## Build with goreleaser (snapshot)
@which goreleaser > /dev/null || (echo "goreleaser not found. Install: go install github.com/goreleaser/goreleaser/v2@latest" && exit 1)
goreleaser build --snapshot --clean
@echo "Build artifacts in ./dist/"
build-quick: ## Quick development build (./sbomlyze)
go build -o sbomlyze ./cmd/sbomlyze
@echo "Built ./sbomlyze"
snapshot-test: ## Run snapshot tests only
go test -v -run TestSnapshot ./cmd/sbomlyze/
update-snapshot: ## Update snapshot golden files (use NAME= to filter)
ifdef NAME
go test -v -run TestSnapshot ./cmd/sbomlyze/ -update -snapshot-filter="$(NAME)"
else
@echo "Updating ALL snapshots. Use NAME=foo,bar to update selectively."
@echo "Run 'make snapshot-diff' first to review changes."
@echo ""
go test -v -run TestSnapshot ./cmd/sbomlyze/ -update
endif
snapshot-diff: ## Show what snapshot changes would occur (no writes)
go test -v -run TestSnapshot ./cmd/sbomlyze/ -diff
snapshot-review: ## Interactively review and accept snapshot changes
@bash scripts/review-snapshots.sh
clean: ## Remove build artifacts
rm -rf dist/ sbomlyze
help: ## Show this help
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}'
@echo ""
@echo "Pre-commit checklist:"
@echo " make test && make lint"