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 766a26ac1f
12 changed files with 171 additions and 27 deletions

14
script/check Normal file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# script/check: run all checks (test, lint, fmt-check). Our own
# extension to scripts-to-rule-them-all. Must not modify any files.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
main() {
"$SCRIPT_DIR/test"
"$SCRIPT_DIR/lint"
"$SCRIPT_DIR/fmt-check"
}
main "$@"

12
script/docker Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# script/docker: build the Docker image.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
main() {
cd "$ROOT"
docker build -t prompts .
}
main "$@"

12
script/fmt Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# script/fmt: format all files (writes).
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
main() {
cd "$ROOT"
yarn run prettier --write '**/*.md' --tab-width 4 --prose-wrap always
}
main "$@"

12
script/fmt-check Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# script/fmt-check: check formatting (read-only).
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
main() {
cd "$ROOT"
yarn run prettier --check '**/*.md' --tab-width 4 --prose-wrap always
}
main "$@"

13
script/lint Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# script/lint: run the linter.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
main() {
cd "$ROOT"
echo "Linting markdown files..."
yarn run prettier --check '**/*.md' --tab-width 4 --prose-wrap always
}
main "$@"

12
script/precommit Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# script/precommit: run by the git pre-commit hook; fails the commit if
# checks fail. Our own extension to scripts-to-rule-them-all.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
main() {
"$SCRIPT_DIR/check"
}
main "$@"

12
script/test Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# script/test: run the test suite.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
main() {
cd "$ROOT"
echo "No tests defined."
}
main "$@"