diff options
| -rwxr-xr-x | hooks/pre-commit | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/hooks/pre-commit b/hooks/pre-commit index 04fdaf8ec..098a99216 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit | |||
| @@ -24,20 +24,3 @@ If you know what you are doing, you can try 'git commit --no-verify' to bypass t | |||
| 24 | END | 24 | END |
| 25 | exit 1 | 25 | exit 1 |
| 26 | fi | 26 | fi |
| 27 | |||
| 28 | for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do | ||
| 29 | if ! echo "$f" | egrep -q "[.](cpp|h)$"; then | ||
| 30 | continue | ||
| 31 | fi | ||
| 32 | if ! echo "$f" | egrep -q "^src/"; then | ||
| 33 | continue | ||
| 34 | fi | ||
| 35 | d=$(clang-format "$f" | diff -u "$f" -) | ||
| 36 | if ! [ -z "$d" ]; then | ||
| 37 | echo "!!! $f not compliant to coding style, here is the fix:" | ||
| 38 | echo "$d" | ||
| 39 | fail=1 | ||
| 40 | fi | ||
| 41 | done | ||
| 42 | |||
| 43 | exit "${fail-0}" | ||