Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims

This commit is contained in:
2026-07-07 01:56:44 +02:00
parent e0b1e7cf54
commit 7508a39d3a
16 changed files with 332 additions and 14 deletions

View File

@@ -1,22 +1,28 @@
.PHONY: test lint fmt fmt-check check build run dev deps docker clean hooks css
.PHONY: bootstrap setup test lint fmt fmt-check check build run dev deps docker clean hooks css
# Default target
.DEFAULT_GOAL := check
bootstrap:
@script/bootstrap
setup:
@script/setup
test:
go test -v -race -timeout 30s ./...
@script/test
lint:
golangci-lint run --config .golangci.yml ./...
@script/lint
fmt:
gofmt -s -w .
@command -v goimports >/dev/null 2>&1 && goimports -w . || true
@script/fmt
fmt-check:
@test -z "$$(gofmt -s -l .)" || { echo "gofmt needed on:"; gofmt -s -l .; exit 1; }
@script/fmt-check
check: fmt-check lint test build
check:
@script/check
build:
go build -o bin/webhooker ./cmd/webhooker
@@ -32,15 +38,13 @@ deps:
go mod tidy
docker:
docker build -t webhooker:latest .
@script/docker
clean:
rm -rf bin/
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
css:
tailwindcss -i static/css/input.css -o static/css/tailwind.css --minify