]> 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)
committerShivani Bhardwaj <shivanib134@gmail.com>
Mon, 29 Apr 2024 06:22:08 +0000 (11:52 +0530)
Add clang-format-14 as the preferred version, this is the default on
Ubuntu 22.04.

(cherry picked from commit 5ebae1e8ed85134d2aaf246a80fad7a4380a1229)

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"