Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims, policy update
Some checks failed
check / check (push) Failing after 5s

This commit is contained in:
2026-07-06 22:00:25 +02:00
parent cc5d877779
commit 9b17cddc8b
16 changed files with 241 additions and 36 deletions

View File

@@ -1,31 +1,26 @@
.PHONY: 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).
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