|
29 | 29 | if (( ${#files[@]} )); then
|
30 | 30 | TOOLCHAIN_DIR=Toolchain/Local/clang/bin
|
31 | 31 | CLANG_FORMAT=false
|
32 |
| - if command -v clang-format-16 >/dev/null 2>&1 ; then |
33 |
| - CLANG_FORMAT=clang-format-16 |
34 |
| - elif command -v brew >/dev/null 2>&1 && command -v "$(brew --prefix llvm@16)"/bin/clang-format >/dev/null 2>&1 ; then |
35 |
| - CLANG_FORMAT="$(brew --prefix llvm@16)"/bin/clang-format |
36 |
| - elif command -v $TOOLCHAIN_DIR/clang-format >/dev/null 2>&1 && $TOOLCHAIN_DIR/clang-format --version | grep -qF ' 16.' ; then |
| 32 | + if command -v clang-format-18 >/dev/null 2>&1 ; then |
| 33 | + CLANG_FORMAT=clang-format-18 |
| 34 | + elif command -v brew >/dev/null 2>&1 && command -v "$(brew --prefix llvm@18)"/bin/clang-format >/dev/null 2>&1 ; then |
| 35 | + CLANG_FORMAT="$(brew --prefix llvm@18)"/bin/clang-format |
| 36 | + elif command -v $TOOLCHAIN_DIR/clang-format >/dev/null 2>&1 && $TOOLCHAIN_DIR/clang-format --version | grep -qF ' 18.' ; then |
37 | 37 | CLANG_FORMAT=$TOOLCHAIN_DIR/clang-format
|
38 | 38 | elif command -v clang-format >/dev/null 2>&1 ; then
|
39 | 39 | CLANG_FORMAT=clang-format
|
40 |
| - if ! "${CLANG_FORMAT}" --version | awk '{ if (substr($NF, 1, index($NF, ".") - 1) < 16) exit 1; }'; then |
41 |
| - echo "You are using '$("${CLANG_FORMAT}" --version)', which appears to not be clang-format 16 or later." |
| 40 | + if ! "${CLANG_FORMAT}" --version | awk '{ if (substr($NF, 1, index($NF, ".") - 1) < 18) exit 1; }'; then |
| 41 | + echo "You are using '$("${CLANG_FORMAT}" --version)', which appears to not be clang-format 18 or later." |
42 | 42 | echo "It is very likely that the resulting changes are not what you wanted."
|
43 | 43 | fi
|
44 | 44 | else
|
45 |
| - echo "clang-format-16 is not available, but C or C++ files need linting! Either skip this script, or install clang-format-16." |
46 |
| - echo "(If you install a package 'clang-format', please make sure it's version 16 or later.)" |
| 45 | + echo "clang-format-18 is not available, but C or C++ files need linting! Either skip this script, or install clang-format-18." |
| 46 | + echo "(If you install a package 'clang-format', please make sure it's version 18 or later.)" |
47 | 47 | exit 1
|
48 | 48 | fi
|
49 | 49 |
|
|
0 commit comments