pokediamond/.githooks/pre-commit
2024-09-30 18:18:30 +01:00

10 lines
261 B
Bash

#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# Run clang-format on staged files; abort the commit if any files are changed
if ! git clang-format --extensions c,cpp,h,hpp ; then
echo "linting made changes to source files; aborting commit"
exit 1
fi