grokkit/Makefile
Greg Gauthier 0aa806be70
Some checks failed
CI / Test (push) Failing after 25s
CI / Lint (push) Has been skipped
CI / Build (push) Has been skipped
feat(cmd): add AI documentation generation and command tests
- Implemented `grokkit docs` command for generating language-specific documentation comments (godoc, PEP 257, Doxygen, etc.) with previews, backups, and auto-apply option
- Extracted message builder functions for commit, history, pr-describe, and review commands
- Added comprehensive unit tests for all command message builders (commit_test.go, docs_test.go, history_test.go, lint_test.go, prdescribe_test.go, review_test.go)
- Enforced 70% test coverage threshold in CI workflow
- Added .golangci.yml configuration with linters like govet, errcheck, staticcheck
- Updated Makefile to include -race in tests and add help target
- Updated README.md with new docs command details, workflows, and quality features
- Added .claude/ to .gitignore
- Configured default model for docs command in config.go
2026-03-02 20:13:50 +00:00

45 lines
1.7 KiB
Makefile

.PHONY: test test-cover test-agent lint build install clean help
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)
test:
go test ./... -v -race
test-cover:
@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"
test-agent:
go test -run TestAgent ./... -v
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
build:
@mkdir -p build
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)"
install: build
mkdir -p ~/.local/bin
cp build/grokkit ~/.local/bin/grokkit
chmod +x ~/.local/bin/grokkit
@echo "✅ grokkit installed to ~/.local/bin"
clean:
rm -rf build/
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"
@echo " lint Run golangci-lint (matches CI pipeline)"
@echo " build Build optimized binary"
@echo " install Build and install to ~/.local/bin"
@echo " clean Remove build artifacts"