-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (43 loc) · 1.5 KB
/
Makefile
File metadata and controls
54 lines (43 loc) · 1.5 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
# Wraith Package Scanner Makefile
default: help
# Build configuration
BINARY_NAME = wraith
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS = -ldflags "-X main.version=$(VERSION)"
.PHONY: help
help: ## Show this help
@echo "Usage: make [target]\n"
@cat ${MAKEFILE_LIST} | grep "[#]# " | grep -v grep | sort | column -t -s '##' | sed -e 's/^/ /'
@echo ""
.PHONY: deps
deps: ## Install Go dependencies
go mod download
go mod tidy
.PHONY: clean
clean: ## Clean test cache and tidy module
go clean -testcache
go mod tidy
.PHONY: test-all
test-all: ## Run all tests (unit + integration)
go test -v ./...
.PHONY: test
test: ## Run unit tests only (fast, no OSV-Scanner required)
go test -v ./pkg/... -short
.PHONY: test-integration
test-integration: ## Run integration tests (requires OSV-Scanner)
@which osv-scanner || (echo "❌ osv-scanner not found in PATH." && exit 1)
go test -v ./pkg/... -run "Integration"
.PHONY: test-demo
test-demo: ## Run live demo with real lockfiles
@which osv-scanner || (echo "❌ osv-scanner not found in PATH." && exit 1)
go test -v ./pkg/... -run "QuickScan"
.PHONY: lint
lint: ## Run linter
@which golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run
.PHONY: release
release: ## Create a release using GoReleaser
goreleaser release --clean
.PHONY: release-snapshot
release-snapshot: ## Create a snapshot release (no tagging required)
goreleaser build --snapshot --clean --single-target