.clang_format.hook 361 字节
Newer Older
Y
Yibing Liu 已提交
1 2
#!/usr/bin/env bash
set -e
Y
Yibing Liu 已提交
3

4
readonly VERSION="3.8"
Y
Yibing Liu 已提交
5 6 7 8 9 10 11 12 13

version=$(clang-format -version)

if ! [[ $version == *"$VERSION"* ]]; then
    echo "clang-format version check failed."
    echo "a version contains '$VERSION' is needed, but get '$version'"
    echo "you can install the right version, and make an soft-link to '\$PATH' env"
    exit -1
fi
Y
Yibing Liu 已提交
14 15

clang-format $@