Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims
This commit is contained in:
35
Makefile
35
Makefile
@@ -6,19 +6,42 @@ GIT_REVISION_SHORT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "un
|
||||
VERSION_PKG := git.eeqj.de/sneak/routewatch/internal/version
|
||||
LDFLAGS := -X $(VERSION_PKG).GitRevision=$(GIT_REVISION) -X $(VERSION_PKG).GitRevisionShort=$(GIT_REVISION_SHORT)
|
||||
|
||||
.PHONY: test fmt lint build clean run asupdate
|
||||
.PHONY: bootstrap setup check test lint fmt fmt-check docker hooks build clean run asupdate
|
||||
|
||||
all: test
|
||||
|
||||
test: lint
|
||||
go test -v ./...
|
||||
# Install all development dependencies.
|
||||
bootstrap:
|
||||
@script/bootstrap
|
||||
|
||||
# Prepare a fresh clone: bootstrap plus pre-commit hook.
|
||||
setup:
|
||||
@script/setup
|
||||
|
||||
# Combined pre-commit/CI gate: tests, lint, format check.
|
||||
check:
|
||||
@script/check
|
||||
|
||||
test:
|
||||
@script/test
|
||||
|
||||
fmt:
|
||||
go fmt ./...
|
||||
@script/fmt
|
||||
|
||||
# Check if code is formatted (read-only).
|
||||
fmt-check:
|
||||
@script/fmt-check
|
||||
|
||||
lint:
|
||||
go vet ./...
|
||||
golangci-lint run
|
||||
@script/lint
|
||||
|
||||
# Build Docker image.
|
||||
docker:
|
||||
@script/docker
|
||||
|
||||
# Install pre-commit hook.
|
||||
hooks:
|
||||
@script/install-precommit
|
||||
|
||||
build:
|
||||
CGO_ENABLED=1 go build -ldflags "$(LDFLAGS)" -o bin/routewatch cmd/routewatch/main.go
|
||||
|
||||
Reference in New Issue
Block a user