#!/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.
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 "$@"
