File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ readonly VERSION=" 3.8"
5+
6+ version=$( clang-format -version)
7+
8+ if ! [[ $version == * " $VERSION " * ]]; then
9+ echo " clang-format version check failed."
10+ echo " a version contains '$VERSION ' is needed, but get '$version '"
11+ echo " you can install the right version, and make an soft-link to '\$ PATH' env"
12+ exit -1
13+ fi
14+
15+ clang-format $@
Original file line number Diff line number Diff line change 1919 - id : end-of-file-fixer
2020- repo : local
2121 hooks :
22- - id : clang-format
22+ - id : clang-format-with-version-check
2323 name : clang-format
2424 description : Format files with ClangFormat.
25- entry : clang-format -i
25+ entry : ./.clang_format.hook -i
2626 language : system
2727 files : \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto)$
2828- repo : https://github.com/PaddlePaddle/pre-commit-golang
You can’t perform that action at this time.
0 commit comments