From 328c27df97e28eceabf7e88b1c15d56db3045ee8 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Mon, 7 Oct 2024 23:30:45 -0600 Subject: [PATCH] Upgrade to clang-format-18 --- .github/workflows/ci.yml | 4 ++-- CMakeLists.txt | 2 +- cmake/Format.cmake | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54491bee71..31b97a1bae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -269,7 +269,7 @@ jobs: format: name: Formatting - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false @@ -279,7 +279,7 @@ jobs: uses: actions/checkout@v4 - name: Format Code - run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-14 -P cmake/Format.cmake + run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-18 -P cmake/Format.cmake - name: Check Formatting run: git diff --exit-code diff --git a/CMakeLists.txt b/CMakeLists.txt index 64f663f646..57872eced6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -529,7 +529,7 @@ if(SFML_BUILD_TEST_SUITE) endif() endif() -sfml_set_option(CLANG_FORMAT_EXECUTABLE clang-format STRING "Override clang-format executable, requires version 14") +sfml_set_option(CLANG_FORMAT_EXECUTABLE clang-format STRING "Override clang-format executable, requires version 18") add_custom_target(format COMMAND ${CMAKE_COMMAND} -DCLANG_FORMAT_EXECUTABLE=${CLANG_FORMAT_EXECUTABLE} -P ./cmake/Format.cmake WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM) diff --git a/cmake/Format.cmake b/cmake/Format.cmake index 416914c600..05825b8a3a 100644 --- a/cmake/Format.cmake +++ b/cmake/Format.cmake @@ -13,8 +13,8 @@ endif() execute_process(COMMAND ${CLANG_FORMAT_EXECUTABLE} --version OUTPUT_VARIABLE CLANG_FORMAT_VERSION) string(REGEX MATCH "clang-format version ([0-9]+)" CLANG_FORMAT_VERSION ${CLANG_FORMAT_VERSION}) unset(CLANG_FORMAT_VERSION) -if(NOT CMAKE_MATCH_1 EQUAL 14) - message(FATAL_ERROR "clang-format version ${CMAKE_MATCH_1} not supported. Must use version 14") +if(NOT CMAKE_MATCH_1 EQUAL 18) + message(FATAL_ERROR "clang-format version ${CMAKE_MATCH_1} not supported. Must use version 18") endif() # Run