File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1919if [ " ${STYLE} " != " " ]; then
2020 STYLE=" :${STYLE} "
2121fi
22+ if clang-format --version | grep -q " version 14\." ; then
23+ CLANG_FORMAT=clang-format
24+ elif which clang-format-14 > /dev/null; then
25+ # clang-format-14 is installed, use it instead!
26+ CLANG_FORMAT=clang-format-14
27+ else
28+ echo " Warning: clang-format 14 not found!"
29+ echo " The formatted code is likely to fail vatomic CICD pipeline"
30+ fi
2231
2332# Apply clang-format to all *.h and *.c files in src folder.
2433find " $@ " \( -name ' *.h' -o -name ' *.c' -o -name ' *.cpp' -o -name ' *.hpp' -o -name ' *.cxx' \) \
2534 -not -path ' */build/*' \
2635 -not -path ' */deps/*' \
2736 -type f \
28- -exec clang-format -style=file${STYLE} -i {} +
37+ -exec ${CLANG_FORMAT} -style=file${STYLE} -i {} +
2938
3039if [ " ${SILENT} " != " true" ]; then
3140 # Display changed files and exit with 1 if there were differences.
You can’t perform that action at this time.
0 commit comments