Files
go-cuckoo/Makefile
T
mvhutz 05dbda496a
CI / Check PR Title (push) Has been skipped
CI / Go Lint (push) Successful in 1m23s
CI / Makefile Lint (push) Successful in 1m17s
CI / Markdown Lint (push) Successful in 47s
CI / Unit Tests (push) Successful in 1m12s
CI / Fuzz Tests (push) Successful in 2m16s
CI / Mutation Tests (push) Successful in 1m39s
ci: use go tool (#25)
## Description

Tool versions were not pinned to the repository: this caused issues with upgrades.

## Changes

- Use `go tool` for `checkmake`, `gremlins`, `golangci-lint`, `godoc` and `govulncheck`.

### Design Decisions

## Checklist

- [x] Tests pass
- [x] Docs updated

Reviewed-on: #25
Co-authored-by: M.V. Hutz <git@maximhutz.me>
Co-committed-by: M.V. Hutz <git@maximhutz.me>
2026-07-03 23:53:17 +00:00

43 lines
1.2 KiB
Makefile

.PHONY: all help install clean test-unit test-mutation test-fuzz test docs lint-go lint-makefile lint-markdown lint
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) | awk -F ':.*## ' '{printf " %-15s %s\n", $$1, $$2}'
install: ## Install dev tools
go mod download
test-unit: ## Run unit tests with coverage
go test ./... -cover -v
test-mutation: ## Run mutation tests with gremlins
go tool gremlins unleash
FUZZ_TIME ?= 30
test-fuzz: ## Run all fuzz tests for 30s each
@for func in $$(grep -r --include='*_test.go' -oh 'func Fuzz\w*' . | sed 's/func //'); do \
echo "Fuzzing $$func..."; \
go test ./... -fuzz="^$$func$$" -fuzztime=$(FUZZ_TIME)s; \
done
test: test-unit test-mutation test-fuzz ## Run all tests
lint-go: ## Lint Go code
go tool golangci-lint run ./...
lint-makefile: ## Lint the Makefile
go tool checkmake Makefile
lint-markdown: ## Lint Markdown files
docker run --rm -v $(CURDIR):/workdir davidanson/markdownlint-cli2 "**/*.md"
lint: lint-go lint-makefile lint-markdown ## Lint all code
docs: ## Serve godoc locally
@echo ">>> Visit: http://localhost:6060/pkg/$$(go list -m)"
go tool godoc -http=:6060
clean: ## Clean build and test caches
go clean -cache -testcache
all: lint test ## Run all checks and tests