1
0
Fork 0
mirror of https://github.com/fastogt/fastocloud.git synced 2025-02-12 16:51:56 +00:00
fastocloud/scripts/pre-commit
2024-10-28 09:05:14 +03:00

15 lines
285 B
Bash

#!/bin/sh
TOTAL_ERRORS=0
for file in `git diff-index --name-only --diff-filter=d HEAD`; do
case "${file#*.}" in
cpp|c|h)
clang-format -i "${file}"
cpplint "${file}"
TOTAL_ERRORS=$(expr $TOTAL_ERRORS + $?);
;;
esac
done
exit $TOTAL_ERRORS