Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims, policy update (#23)
All checks were successful
check / check (push) Successful in 5s

Reviewed-on: #23
Co-authored-by: sneak <sneak@sneak.berlin>
Co-committed-by: sneak <sneak@sneak.berlin>
This commit was merged in pull request #23.
This commit is contained in:
2026-07-06 23:53:05 +02:00
committed by Jeffrey Paul
parent cc5d877779
commit 3d8d1c0600
19 changed files with 442 additions and 46 deletions

View File

@@ -1,31 +1,32 @@
.PHONY: test lint fmt fmt-check check docker hooks
.PHONY: bootstrap setup test lint fmt fmt-check check docker hooks
# flags are repeated here (also in .prettierrc) so this Makefile works
# standalone when copied as a template
PRETTIER := yarn run prettier
# Makefile targets are thin shims; the implementations live in script/
# per the scripts-to-rule-them-all pattern (see the Entrypoints section
# of README.md).
bootstrap:
@script/bootstrap
setup:
@script/setup
test:
@echo "No tests defined."
@script/test
lint:
@echo "Linting markdown files..."
@$(PRETTIER) --check '**/*.md' --tab-width 4 --prose-wrap always
@script/lint
fmt:
@$(PRETTIER) --write '**/*.md' --tab-width 4 --prose-wrap always
@script/fmt
fmt-check:
@$(PRETTIER) --check '**/*.md' --tab-width 4 --prose-wrap always
@script/fmt-check
check: test lint fmt-check
check:
@script/check
docker:
docker build -t prompts .
@script/docker
hooks:
@printf '#!/bin/sh\nset -e\n' > .git/hooks/pre-commit
@if [ -f go.mod ]; then \
printf 'go mod tidy\ngo fmt ./...\ngit diff --exit-code -- go.mod go.sum || { echo "go mod tidy changed files; please stage and retry"; exit 1; }\n' >> .git/hooks/pre-commit; \
fi
@printf 'make check\n' >> .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@script/install-precommit