Files
fallout2-ce/scripts/setup-git-hooks.sh
T
Vasilii RoginandCursor cf09aefc79 feat: add optional pre-commit hook for staged C++ formatting
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>
2026-05-15 15:47:36 +03:00

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."