Skip to content

Commit

Permalink
Upgrade to clang-format-18
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Oct 8, 2024
1 parent d9f3634 commit 328c27d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ jobs:

format:
name: Formatting
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

strategy:
fail-fast: false
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions cmake/Format.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 328c27d

Please sign in to comment.