Files
pathfinding_demo/scripts/pre-commit.sample
2025-10-30 15:18:41 +01:00

10 lines
225 B
Bash

#!/bin/sh
# Copy this file to .git/hooks
# Run clang-format before commiting
files=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(cpp|hpp)$')
[ -z "$files" ] && exit 0
clang-format -i $files
git add $files