Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims
This commit is contained in:
28
Makefile
28
Makefile
@@ -1,28 +1,30 @@
|
||||
.PHONY: test fmt fmt-check lint check docker hooks
|
||||
.PHONY: bootstrap setup test fmt fmt-check lint check docker hooks
|
||||
|
||||
default: check
|
||||
|
||||
bootstrap:
|
||||
@script/bootstrap
|
||||
|
||||
setup:
|
||||
@script/setup
|
||||
|
||||
test:
|
||||
@go test -v ./...
|
||||
@script/test
|
||||
|
||||
fmt:
|
||||
goimports -l -w .
|
||||
golangci-lint run --fix
|
||||
@script/fmt
|
||||
|
||||
fmt-check:
|
||||
@test -z "$$(gofmt -l .)" || { echo "gofmt would reformat:"; gofmt -l .; exit 1; }
|
||||
@script/fmt-check
|
||||
|
||||
lint:
|
||||
golangci-lint run
|
||||
@script/lint
|
||||
|
||||
check: fmt-check lint test
|
||||
check:
|
||||
@script/check
|
||||
|
||||
docker:
|
||||
docker build --progress plain .
|
||||
@script/docker
|
||||
|
||||
hooks:
|
||||
@echo "Installing git hooks..."
|
||||
@mkdir -p .git/hooks
|
||||
@printf '#!/bin/sh\nmake check\n' > .git/hooks/pre-commit
|
||||
@chmod +x .git/hooks/pre-commit
|
||||
@echo "Pre-commit hook installed."
|
||||
@script/install-precommit
|
||||
|
||||
Reference in New Issue
Block a user