Skip to content

Commit ddcb8ef

Browse files
committed
build: add Makefile with 'make build' gate
CLAUDE.md references 'make build' (lint + govulncheck + test) but no Makefile existed. Add one whose build target runs tidy, vet, compile, govulncheck, and test (a superset of CI plus govulncheck), with fmt, lint (golangci-lint), and binary as separate targets.
1 parent c136065 commit ddcb8ef

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Makefile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Verification entry points for latere-cli.
2+
#
3+
# `make build` is the gate referenced in CLAUDE.md: lint + govulncheck + test.
4+
# It is a superset of CI (.github/workflows/ci.yaml runs tidy/vet/build/test),
5+
# adding govulncheck. Run it before committing.
6+
7+
GO ?= go
8+
9+
.PHONY: build
10+
build: tidy vet compile vuln test ## Full verification gate (run before committing)
11+
12+
.PHONY: tidy
13+
tidy: ## Fail if go.mod/go.sum are not tidy
14+
$(GO) mod tidy -diff
15+
16+
.PHONY: vet
17+
vet: ## go vet
18+
$(GO) vet ./...
19+
20+
.PHONY: compile
21+
compile: ## Compile all packages
22+
$(GO) build ./...
23+
24+
.PHONY: test
25+
test: ## Run tests
26+
$(GO) test ./...
27+
28+
.PHONY: vuln
29+
vuln: ## Scan for known vulnerabilities
30+
$(GO) run golang.org/x/vuln/cmd/govulncheck@latest ./...
31+
32+
.PHONY: fmt
33+
fmt: ## Format all Go sources in place
34+
gofmt -w .
35+
36+
.PHONY: lint
37+
lint: ## Stricter lint via golangci-lint (has pre-existing findings; not in `make build`)
38+
golangci-lint run ./...
39+
40+
.PHONY: binary
41+
binary: ## Build the latere binary into ./latere
42+
$(GO) build -o latere ./cmd/latere
43+
44+
.PHONY: help
45+
help: ## List targets
46+
@grep -hE '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | \
47+
awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'

0 commit comments

Comments
 (0)