check / check (push) Successful in 2m9s
The repo's first code, with the layout the prompts policies ask for: Makefile, script/ entrypoints, a Dockerfile whose lint and test phases gate the build, the Gitea workflow, the canonical dotfiles and REPO_POLICIES.md. smallwebwaf passes each request to the app through httputil.ReverseProxy within the four timeouts and two size limits, works out the client's address behind trusted proxies, and writes one JSON line per request. The tests run against real local servers. SPEC.md now says what Go's HTTP server does before smallwebwaf sees a request; make fmt only rewraps EVALUATION.md. Model: opus-5-5
34 lines
950 B
Bash
Executable File
34 lines
950 B
Bash
Executable File
#!/bin/sh
|
|
# script/fmt: format all files (writes): the Go code with gofmt, the
|
|
# Markdown with prettier.
|
|
set -eu
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
|
|
|
# Must match the pin in script/bootstrap.
|
|
NODE_VERSION="22.17.0"
|
|
|
|
# script/bootstrap installs node and yarn under nvm and leaves neither
|
|
# on the PATH of the shell that called it, so resolve the pinned
|
|
# toolchain here the way bootstrap's own install step does. nvm is a
|
|
# bash script, hence the subshell.
|
|
run_yarn() {
|
|
if command -v yarn >/dev/null 2>&1; then
|
|
exec yarn "$@"
|
|
fi
|
|
if [ ! -s "$HOME/.nvm/nvm.sh" ]; then
|
|
echo "fmt: no yarn; run script/bootstrap first" >&2
|
|
exit 1
|
|
fi
|
|
exec bash -c '. "$HOME/.nvm/nvm.sh" && nvm use "$1" >/dev/null &&
|
|
shift && exec yarn "$@"' bash "$NODE_VERSION" "$@"
|
|
}
|
|
|
|
main() {
|
|
cd "$ROOT"
|
|
gofmt -w cmd internal
|
|
run_yarn run prettier --write '**/*.md' --tab-width 4 --prose-wrap always
|
|
}
|
|
|
|
main "$@"
|