mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
Add .githooks/pre-commit (clang-format 14 on staged *.cc/*.h, warn-only if unavailable) and setup scripts for core.hooksPath. Document in CONTRIBUTING.md and verify the hook on the macOS format CI job. Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
497 B
Bash
Executable File
20 lines
497 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Point this repository at .githooks/ (pre-commit formats staged C++ files).
|
|
|
|
set -euo pipefail
|
|
|
|
ROOT=$(cd "$(dirname "$0")/.." && pwd)
|
|
cd "$ROOT"
|
|
|
|
if [ ! -f .githooks/pre-commit ]; then
|
|
echo "error: missing .githooks/pre-commit" >&2
|
|
exit 1
|
|
fi
|
|
|
|
chmod +x .githooks/pre-commit
|
|
|
|
git config --local core.hooksPath .githooks
|
|
|
|
echo "Installed git hooks (core.hooksPath=.githooks)."
|
|
echo "pre-commit will format staged src/*.cc and src/*.h when clang-format 14 is available."
|