-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (31 loc) · 1.29 KB
/
Copy pathMakefile
File metadata and controls
43 lines (31 loc) · 1.29 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
# yourdata — developer tasks. Run `make check` before pushing.
.DEFAULT_GOAL := check
.PHONY: fmt lint test build tidy check run inspect clean help
GO ?= go
BINARY := yourdata
BIN := bin/$(BINARY)
# Every binary is statically linked (CGO_ENABLED=0): pure Go by design, so it
# runs unchanged in musl/distroless/scratch images and can be bind-mounted into
# an MCP host container. A glibc-dynamic build fails there with a misleading
# `spawn ... ENOENT` — the missing file is the ELF interpreter, not the binary.
GOENV := CGO_ENABLED=0
fmt: ## Format code with gofumpt
gofumpt -w .
lint: ## Run golangci-lint (v2)
golangci-lint run
test: ## Run tests with the race detector and coverage
$(GO) test ./... -race -cover
build: ## Build the static binary at bin/yourdata
$(GOENV) $(GO) build -o $(BIN) .
tidy: ## Sync go.mod / go.sum
$(GO) mod tidy
check: fmt tidy lint test ## Full pre-push gate
run: ## Run the TUI from source
$(GOENV) $(GO) run .
inspect: build ## Inspect the MCP surface (tools, resources, prompts, ui:// widgets)
npx @modelcontextprotocol/inspector ./$(BIN) mcp
clean: ## Remove build output
rm -rf bin/
help: ## List targets
@grep -hE '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-8s\033[0m %s\n", $$1, $$2}'