diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index ec4cabfbf3..27d1daa8c8 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -27,9 +27,9 @@ jobs: # Checking for correct formatting of branch for C code changes check-formatting: - name: Formatting Check (clang 14) - runs-on: ubuntu-22.04 - container: ubuntu:22.04 + name: Formatting Check (clang 17) + runs-on: ubuntu-latest + container: ubuntu:24.04 continue-on-error: false steps: @@ -50,7 +50,7 @@ jobs: automake \ cargo \ cbindgen \ - clang-format-14 \ + clang-format-17 \ git \ libtool \ libpcap-dev \ diff --git a/scripts/clang-format.sh b/scripts/clang-format.sh index cb11f9e7c6..ab1f73c897 100755 --- a/scripts/clang-format.sh +++ b/scripts/clang-format.sh @@ -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-14 git-clang-format-11 git-clang-format-10 git-clang-format-9 git-clang-format +RequireProgram GIT_CLANG_FORMAT git-clang-format-17 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-14$ ]]; then +if [[ $GIT_CLANG_FORMAT =~ .*git-clang-format-17$ ]]; then + # default binary is clang-format, specify the correct version. + # Alternative: git config clangformat.binary "clang-format-17" + GIT_CLANG_FORMAT_BINARY="clang-format-17" +elif [[ $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"