File: pre-commit

package info (click to toggle)
qca2 2.3.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 5,884 kB
  • sloc: cpp: 59,224; ansic: 814; perl: 133; sh: 89; makefile: 34
file content (10 lines) | stat: -rw-r--r-- 353 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env bash

readonly output=$(git clang-format -v --diff)

if [[ "$output" == *"no modified files to format"* ]]; then exit 0; fi
if [[ "$output" == *"clang-format did not modify any files"* ]]; then exit 0; fi

echo "ERROR: you need to run git clang-format on your commit"
echo "       git clang-format -f is potentially what you want"
exit 1