Skip to content

Commit 6e1dae1

Browse files
committed
Change cmake-format print and doc
1 parent ae303e9 commit 6e1dae1

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

CMakeLists.txt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ if(UMF_FORMAT_CODE_STYLE)
235235
message(STATUS "Found cmake-format: ${CMAKE_FORMAT} "
236236
"(version: ${CMAKE_FORMAT_VERSION})")
237237

238-
# Check if cmake-format (in correct version) is available for code
239-
# formatting.
238+
# Check if cmake-format (in correct version) is available for cmake
239+
# files formatting.
240240
set(CMAKE_FORMAT_REQUIRED "0.6")
241241
if(NOT (CMAKE_FORMAT_VERSION VERSION_EQUAL CMAKE_FORMAT_REQUIRED))
242242
message(FATAL_ERROR "Required cmake-format version is"
@@ -248,12 +248,13 @@ if(UMF_FORMAT_CODE_STYLE)
248248
message(
249249
FATAL_ERROR
250250
"UMF_FORMAT_CODE_STYLE=ON, but neither clang-format (required version: "
251-
"${CLANG_FORMAT_REQUIRED}) nor cmake-format was found.")
251+
"${CLANG_FORMAT_REQUIRED}) nor cmake-format (required version: "
252+
"${CMAKE_FORMAT_VERSION}) was found.")
252253
endif()
253254

254255
# Obtain files for clang-format check
255256
set(format_glob)
256-
foreach(DIR IN ITEMS include examples src test benchmark)
257+
foreach(DIR IN ITEMS benchmark examples include src test)
257258
list(APPEND format_glob
258259
"${DIR}/*.h"
259260
"${DIR}/*.hpp"
@@ -297,12 +298,6 @@ if(UMF_FORMAT_CODE_STYLE)
297298
file(GLOB_RECURSE format_cmake_list ${format_cmake_glob})
298299
list(APPEND format_cmake_list "${PROJECT_SOURCE_DIR}/CMakeLists.txt")
299300

300-
# Print the list of files targeted for formatting by cmake-format
301-
message(STATUS "Files to be formatted with cmake-format:")
302-
foreach(file IN LISTS format_cmake_list)
303-
message(STATUS "${file}")
304-
endforeach()
305-
306301
message(STATUS "Adding cmake-format-check and cmake-format-apply make "
307302
"targets")
308303

@@ -319,7 +314,7 @@ if(UMF_FORMAT_CODE_STYLE)
319314
# Add a convenience target for running both clang-format and cmake-format
320315
# checks/apply
321316
add_custom_target(
322-
format-checks
317+
format-check
323318
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target
324319
clang-format-check
325320
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ If you wish to use only `clang-format` or only `cmake-format`, you can execute t
9393

9494
**NOTE**: We use specific versions of formatting tools to ensure consistency across the project. The required versions are:
9595
- clang-format version **15.0**, which can be installed with the command: `python -m pip install clang-format==15.0.7`.
96-
- cmake-format version **0.6.13**, which can be installed with the command: `python -m pip install cmake-format==0.6`.
96+
- cmake-format version **0.6**, which can be installed with the command: `python -m pip install cmake-format==0.6.13`.
9797

9898
Please ensure you have these specific versions installed before contributing to the project.
9999

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ List of options provided by CMake:
101101
| UMF_BUILD_EXAMPLES | Build UMF examples | ON/OFF | ON |
102102
| UMF_ENABLE_POOL_TRACKING | Build UMF with pool tracking | ON/OFF | ON |
103103
| UMF_DEVELOPER_MODE | Treat warnings as errors and enables additional checks | ON/OFF | OFF |
104-
| UMF_FORMAT_CODE_STYLE | Add clang and cmake -format-check and -format-apply targets to make | ON/OFF | OFF |
104+
| UMF_FORMAT_CODE_STYLE | Add clang and cmake -format-check and -format-apply targets to make | ON/OFF | OFF |
105105
| USE_ASAN | Enable AddressSanitizer checks | ON/OFF | OFF |
106106
| USE_UBSAN | Enable UndefinedBehaviorSanitizer checks | ON/OFF | OFF |
107107
| USE_TSAN | Enable ThreadSanitizer checks | ON/OFF | OFF |

0 commit comments

Comments
 (0)