Compare commits

..
1 Commits
Author SHA1 Message Date
clawbot 31fbef35d4 Format Markdown with prettier in make fmt and fmt-check (closes #23)
check / check (push) Successful in 3m29s
`make fmt` now runs prettier over the Markdown files after the Go
formatters, and `make fmt-check` fails when prettier would change one.
`package.json`, `yarn.lock`, `.prettierrc` and `.prettierignore` are the
`sneak/prompts` copies at `dd4027b`, and both scripts find yarn the way
that repo's scripts do. `script/bootstrap` installs prettier with
`yarn install --frozen-lockfile`. When the yarn those scripts would run
is not 1.22.22, it installs yarn through corepack under node 22.17.0:
the node on `PATH` if it has that version, otherwise one installed
through nvm from a hash-checked archive. `README.md` and `TODO.md` are
reformatted once.

Model: opus-5-5
2026-10-06 08:36:58 +00:00
4 changed files with 7 additions and 15 deletions

No files matched your search

+3 -3
View File
@@ -102,9 +102,9 @@ Future improvements under consideration:
- Author & maintainer: **sneak** – <sneak@sneak.berlin>
- Issues / PRs: <https://git.eeqj.de/sneak/attrsum/>
- Code must pass `make check`, which runs the tests and golangci-lint as phases
of the `Dockerfile` (Docker is required) and checks formatting with `gofmt -s`
and goimports for Go and prettier for Markdown. `make bootstrap` installs
goimports and prettier, and `make fmt` fixes what the check reports.
of the `Dockerfile` (Docker is required) and checks formatting with `gofmt`
for Go and prettier for Markdown. `make bootstrap` installs prettier, and
`make fmt` fixes what the check reports.
- No CLA; contributions are under WTFPL v2.
---
-3
View File
@@ -28,9 +28,6 @@ TODO, License exist; Description, Entrypoints, Design, Author are missing)
change; prettier is pinned in `package.json` and `yarn.lock`, and
`script/bootstrap` installs it, along with the pinned node and yarn when the
yarn on hand is not the pinned version; the Markdown files reformatted once
- 2026-10-06: `script/fmt-check` checks what `script/fmt` writes: it fails and
lists the files when `gofmt -s` or goimports would change one, so a file that
passes `make check` no longer changes on the next `make fmt`
- 2026-10-06: canonical files re-vendored from `sneak/prompts` at `dd4027b`:
`REPO_POLICIES.md` and `.editorconfig` added; `.dockerignore`, `.gitignore`,
`.golangci.yml` and the workflow refreshed, keeping this repo's own entries
+1 -1
View File
@@ -1,5 +1,5 @@
{
"private": true,
"license": "MIT",
"devDependencies": {
"prettier": "3.8.1"
}
+3 -8
View File
@@ -27,15 +27,10 @@ run_yarn() {
main() {
cd "$ROOT"
# script/bootstrap installs goimports into Go's bin directory, which
# need not be on PATH.
gobin="$(go env GOBIN)"
[ -n "$gobin" ] || gobin="$(go env GOPATH)/bin"
PATH="$gobin:$PATH"
files="$(gofmt -s -l .; goimports -l .)"
files="$(gofmt -l .)"
if [ -n "$files" ]; then
echo "files that make fmt would change:" >&2
echo "$files" | sort -u >&2
echo "gofmt: files not formatted:" >&2
echo "$files" >&2
exit 1
fi
run_yarn run prettier --check '**/*.md' --tab-width 4 --prose-wrap always