]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
clang-format.sh: prefer clang-format-14
authorJason Ish <jason.ish@oisf.net>
Wed, 6 Dec 2023 16:09:03 +0000 (10:09 -0600)
committerVictor Julien <victor@inliniac.net>
Wed, 13 Dec 2023 05:59:31 +0000 (06:59 +0100)
Add clang-format-14 as the preferred version, this is the default on
Ubuntu 22.04.

scripts/clang-format.sh

index fe16db07af41b47abc378fa78c026577d0dea092..fc69e49dbf31874bebe561a8ed7dd463e7dd2122 100755 (executable)
@@ -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"