2026-03-01 14:21:36 +00:00
|
|
|
.PHONY: test test-cover test-agent lint build install clean
|
chore(build): add Makefile and tests for commands and utilities
- Introduced Makefile with targets for testing (all, coverage, agent-specific), building, installing, cleaning, and help
- Added unit and integration tests for agent command, edit command, and CleanCodeResponse function
- Refactored CleanCodeResponse to use regex for robust markdown fence removal in agent and client modules
- Ensured tests cover code cleaning, plan generation placeholders, and file editing functionality
2026-03-01 00:24:48 +00:00
|
|
|
|
2026-03-02 00:10:39 +00:00
|
|
|
VERSION ?= dev-$(shell git describe --tags --always --dirty 2>/dev/null || echo unknown)
|
|
|
|
|
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
|
|
|
|
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || echo unknown)
|
|
|
|
|
|
chore(build): add Makefile and tests for commands and utilities
- Introduced Makefile with targets for testing (all, coverage, agent-specific), building, installing, cleaning, and help
- Added unit and integration tests for agent command, edit command, and CleanCodeResponse function
- Refactored CleanCodeResponse to use regex for robust markdown fence removal in agent and client modules
- Ensured tests cover code cleaning, plan generation placeholders, and file editing functionality
2026-03-01 00:24:48 +00:00
|
|
|
test:
|
|
|
|
|
go test ./... -v
|
|
|
|
|
|
|
|
|
|
test-cover:
|
2026-03-01 12:44:20 +00:00
|
|
|
@mkdir -p build
|
|
|
|
|
go test ./... -coverprofile=build/coverage.out
|
|
|
|
|
go tool cover -html=build/coverage.out -o build/coverage.html
|
|
|
|
|
@echo "✅ Coverage report: open build/coverage.html in your browser"
|
chore(build): add Makefile and tests for commands and utilities
- Introduced Makefile with targets for testing (all, coverage, agent-specific), building, installing, cleaning, and help
- Added unit and integration tests for agent command, edit command, and CleanCodeResponse function
- Refactored CleanCodeResponse to use regex for robust markdown fence removal in agent and client modules
- Ensured tests cover code cleaning, plan generation placeholders, and file editing functionality
2026-03-01 00:24:48 +00:00
|
|
|
|
|
|
|
|
test-agent:
|
|
|
|
|
go test -run TestAgent ./... -v
|
|
|
|
|
|
2026-03-01 14:21:36 +00:00
|
|
|
lint:
|
|
|
|
|
@which golangci-lint > /dev/null || (echo "❌ golangci-lint not found. Install with:" && echo " go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest" && exit 1)
|
|
|
|
|
golangci-lint run
|
|
|
|
|
|
chore(build): add Makefile and tests for commands and utilities
- Introduced Makefile with targets for testing (all, coverage, agent-specific), building, installing, cleaning, and help
- Added unit and integration tests for agent command, edit command, and CleanCodeResponse function
- Refactored CleanCodeResponse to use regex for robust markdown fence removal in agent and client modules
- Ensured tests cover code cleaning, plan generation placeholders, and file editing functionality
2026-03-01 00:24:48 +00:00
|
|
|
build:
|
2026-03-01 12:44:20 +00:00
|
|
|
@mkdir -p build
|
2026-03-02 00:10:39 +00:00
|
|
|
go build -trimpath -ldflags "-s -w -X 'gmgauthier.com/grokkit/internal/version.Version=$(VERSION)' -X 'gmgauthier.com/grokkit/internal/version.Commit=$(COMMIT)' -X 'gmgauthier.com/grokkit/internal/version.BuildDate=$(DATE)'" -o build/grokkit .
|
|
|
|
|
@echo "✅ Dev build: VERSION=$(VERSION) COMMIT=$(COMMIT) DATE=$(DATE)"
|
chore(build): add Makefile and tests for commands and utilities
- Introduced Makefile with targets for testing (all, coverage, agent-specific), building, installing, cleaning, and help
- Added unit and integration tests for agent command, edit command, and CleanCodeResponse function
- Refactored CleanCodeResponse to use regex for robust markdown fence removal in agent and client modules
- Ensured tests cover code cleaning, plan generation placeholders, and file editing functionality
2026-03-01 00:24:48 +00:00
|
|
|
|
|
|
|
|
install: build
|
|
|
|
|
mkdir -p ~/.local/bin
|
|
|
|
|
cp build/grokkit ~/.local/bin/grokkit
|
|
|
|
|
chmod +x ~/.local/bin/grokkit
|
|
|
|
|
@echo "✅ grokkit installed to ~/.local/bin"
|
|
|
|
|
|
|
|
|
|
clean:
|
2026-03-01 12:44:20 +00:00
|
|
|
rm -rf build/
|
chore(build): add Makefile and tests for commands and utilities
- Introduced Makefile with targets for testing (all, coverage, agent-specific), building, installing, cleaning, and help
- Added unit and integration tests for agent command, edit command, and CleanCodeResponse function
- Refactored CleanCodeResponse to use regex for robust markdown fence removal in agent and client modules
- Ensured tests cover code cleaning, plan generation placeholders, and file editing functionality
2026-03-01 00:24:48 +00:00
|
|
|
|
|
|
|
|
help:
|
|
|
|
|
@echo "Available targets:"
|
|
|
|
|
@echo " test Run all tests"
|
|
|
|
|
@echo " test-cover Run tests + generate HTML coverage report"
|
|
|
|
|
@echo " test-agent Run only agent tests"
|
2026-03-01 14:21:36 +00:00
|
|
|
@echo " lint Run golangci-lint (matches CI pipeline)"
|
chore(build): add Makefile and tests for commands and utilities
- Introduced Makefile with targets for testing (all, coverage, agent-specific), building, installing, cleaning, and help
- Added unit and integration tests for agent command, edit command, and CleanCodeResponse function
- Refactored CleanCodeResponse to use regex for robust markdown fence removal in agent and client modules
- Ensured tests cover code cleaning, plan generation placeholders, and file editing functionality
2026-03-01 00:24:48 +00:00
|
|
|
@echo " build Build optimized binary"
|
|
|
|
|
@echo " install Build and install to ~/.local/bin"
|
|
|
|
|
@echo " clean Remove build artifacts"
|