#!/usr/bin/env bash # preflight.sh — pre-push gate. Block A verifies that csproj and repo.json # agree on the version and tag URLs. Block B does a headless `dotnet build` # to catch compile-time API drift. Block C runs `dotnet csharpier check` # against Craftimizer/. Block D runs markdownlint against repo *.md files. set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" echo "==> preflight: Block A — version consistency" ./scripts/verify-version-consistency.sh echo "==> preflight: Block B — plugin compile health" dotnet build Craftimizer/Craftimizer.csproj --configuration Release --nologo --verbosity quiet echo "==> preflight: Block C — csharpier reflow check" dotnet csharpier check Craftimizer/ echo "==> preflight: Block D — markdownlint" # npx --yes avoids a global install; first run caches into ~/.npm/_npx/. # Subsequent runs are sub-second. npx --yes markdownlint-cli2 "**/*.md" "#node_modules" "#bin" "#obj" "#.claude" "#CLAUDE.md" echo "==> preflight: ALL GREEN"