clang-format.sh: prefer clang-format-14

Add clang-format-14 as the preferred version, this is the default on
Ubuntu 22.04.
pull/10043/head
Jason Ish 1 year ago committed by Victor Julien
parent 40e3514e7a
commit 5ebae1e8ed

@ -560,9 +560,13 @@ SetTopLevelDir
RequireProgram GIT git
# ubuntu uses clang-format-{version} name for newer versions. fedora not.
RequireProgram GIT_CLANG_FORMAT git-clang-format-11 git-clang-format-10 git-clang-format-9 git-clang-format
RequireProgram GIT_CLANG_FORMAT git-clang-format-14 git-clang-format-11 git-clang-format-10 git-clang-format-9 git-clang-format
GIT_CLANG_FORMAT_BINARY=clang-format
if [[ $GIT_CLANG_FORMAT =~ .*git-clang-format-11$ ]]; then
if [[ $GIT_CLANG_FORMAT =~ .*git-clang-format-14$ ]]; then
# default binary is clang-format, specify the correct version.
# Alternative: git config clangformat.binary "clang-format-14"
GIT_CLANG_FORMAT_BINARY="clang-format-14"
elif [[ $GIT_CLANG_FORMAT =~ .*git-clang-format-11$ ]]; then
# default binary is clang-format, specify the correct version.
# Alternative: git config clangformat.binary "clang-format-11"
GIT_CLANG_FORMAT_BINARY="clang-format-11"

Loading…
Cancel
Save