#!/bin/sh
# script/fmt-check: check the formatting of this repo's markdown and
# CSS (read-only). Same scope and same settings as script/fmt - keep
# the two in sync - but fails instead of writing.
#
# This runs on the host, not in a container: only linting is
# containerised (owner ruling, 2026-08-10), and a formatting check is
# not a lint. Running here also keeps it usable offline, since npx
# reuses ~/.npm/_npx after the first run.
set -eu

ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"

PRETTIER_VERSION="3.4.2"

main() {
    cd "$ROOT"
    npx --yes "prettier@${PRETTIER_VERSION}" --check \
        '**/*.md' '**/*.css' --tab-width 4 --prose-wrap always
}

main "$@"
