clang_format.hook 353 B

123456789101112131415
  1. #!/bin/bash
  2. set -e
  3. readonly VERSION="3.8"
  4. version=$(clang-format -version)
  5. if ! [[ $version == *"$VERSION"* ]]; then
  6. echo "clang-format version check failed."
  7. echo "a version contains '$VERSION' is needed, but get '$version'"
  8. echo "you can install the right version, and make an soft-link to '\$PATH' env"
  9. exit -1
  10. fi
  11. clang-format $@