#!/usr/bin/env bash # preflight.sh — pre-push gate for the Anvil plugin repository. # # Block A — version consistency between Anvil.csproj and the # public repo.json manifest (when it exists). # Block B — dotnet build -p:Platform=x64 on the solution to catch # compile-time API drift. # Block C — dotnet csharpier check against Anvil/ for C# format drift # (per feedback_hellion_chat_format_check_per_task: accumulated # formatter drift in HellionChat v1.5.6 hit 12 files at push # time when only build was checked per task). # Block D — markdownlint-cli2 against the repo's *.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 Anvil.sln -p:Platform=x64 --configuration Release --nologo --verbosity quiet echo "==> preflight: Block C — csharpier reflow check" dotnet csharpier check ./Anvil echo "==> preflight: Block D — markdownlint" # npx --yes avoids a global install; first run caches into ~/.npm/_npx/. npx --yes markdownlint-cli2 "**/*.md" "#node_modules" "#bin" "#obj" "#.claude" "#CLAUDE.md" echo "==> preflight: ALL GREEN"