-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (58 loc) · 1.72 KB
/
Makefile
File metadata and controls
68 lines (58 loc) · 1.72 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
61
62
63
64
65
66
67
68
.PHONY: build
build: generate fmt lint
@echo "Running go build..."
@go build -o ./bin/gsh ./cmd/gsh/main.go
.PHONY: generate
generate:
@echo "Running go generate..."
@go generate ./...
.PHONY: check-generate
check-generate: generate
@echo "Checking if generated files are up to date..."
@if [ -n "$$(git status --porcelain | grep '_string.go')" ]; then \
echo "Error: Generated files are out of date. Please run 'make generate'"; \
git status --porcelain | grep '_string.go'; \
exit 1; \
fi
@echo "All generated files are up to date!"
.PHONY: fmt
fmt:
@echo "Running golangci-lint fmt..."
@golangci-lint fmt
.PHONY: lint
lint:
@echo "Running golangci-lint run..."
@golangci-lint run
.PHONY: lint-fix
lint-fix:
@echo "Running golangci-lint run with auto-fix..."
@golangci-lint run --fix
.PHONY: test
test: generate
@echo "Running go test..."
@go test -coverprofile=coverage.txt ./...
.PHONY: test-e2e
test-e2e: generate
@echo "Running E2E tests (requires Ollama)..."
@go test -tags=e2e -v ./internal/script/interpreter/... -run TestE2E
.PHONY: clean
clean:
@rm -rf ./bin
@rm -f coverage.out coverage.txt
@echo "Cleaning generated files..."
@find . -name '*_string.go' -type f -delete
.PHONY: ci
ci: check-generate fmt lint test
@echo "CI checks passed!"
.PHONY: install-tools
install-tools:
@echo "Installing development tools..."
@echo "Installing Go tools..."
@go install golang.org/x/tools/cmd/stringer@latest
@if command -v brew >/dev/null 2>&1; then \
echo "Installing golangci-lint via brew..."; \
brew install golangci-lint || brew upgrade golangci-lint; \
else \
echo "Brew not found, skipping golangci-lint (use golangci-lint-action in CI or install manually)"; \
fi
@echo "Tools installed successfully!"