-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (50 loc) · 1.69 KB
/
Copy pathMakefile
File metadata and controls
60 lines (50 loc) · 1.69 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
55
56
57
58
59
60
# cmdscope build and quality targets.
#
# Primary targets:
# make – default: run all tests and quality checks
# make test – run the full test suite
# make quick – fast feedback: build + vet (no tests)
# make fmt – format code and check consistency
# make lint – run all static checks (vet + fmt-diff)
# make ci – full pipeline: fmt, vet, test (what CI should run)
# make schema – validate the schema, examples, and gold corpus
.PHONY: test quick fmt lint ci schema help
.DEFAULT_GOAL := all
all: lint test
@echo "✓ all checks passed"
test:
go test ./... -count=1
quick:
go build ./...
go vet ./...
fmt:
@echo "goimports..."
@if command -v goimports >/dev/null 2>&1; then \
goimports -l -w $$(go list -f '{{.Dir}}' ./... | grep -v /vendor/); \
gofmt -l .; \
else \
gofmt -l -w .; \
fi
lint:
go vet ./...
@fmtout=$$(gofmt -l .); \
if [ -n "$$fmtout" ]; then \
echo "gofmt required:"; echo "$$fmtout"; exit 1; \
fi
@echo "✓ lint passed"
ci: lint test
@echo "✓ ci passed"
schema:
@echo "cmdscope: schema check is not yet implemented"
@echo " Run: go test ./internal/ir -run Schema"
@echo " See CONTRIBUTING.md § Changing the JSON contract for details"
help:
@echo "cmdscope make targets:"
@echo " make / make all – lint + test"
@echo " make test – go test ./..."
@echo " make quick – build + vet (fast)"
@echo " make fmt – format code (goimports or gofmt)"
@echo " make lint – static checks (vet + gofmt diff)"
@echo " make ci – full CI pipeline"
@echo " make schema – schema validation placeholder"
@echo " make help – this message"