Skip to content

Commit

Permalink
GH-37299: [C++] Fix clang-format version mismatch error with Homebrew…
Browse files Browse the repository at this point in the history
…'s clang-format (#37300)

### Rationale for this change

On my mac system, the clang-format version information is:
```
➜  ~ clang-format -version
Homebrew clang-format version 16.0.4
```

This isn't matched by the current clang-format regex in the CMake setup:
```cmake
find_clang_tool(clang-format CLANG_FORMAT_BIN
                "^clang-format version ${ARROW_CLANG_TOOLS_VERSION_ESCAPED}")
```

### What changes are included in this PR?

Make regex more lenient to accomodate the Homebrew clang-format version string.

### Are these changes tested?
no

### Are there any user-facing changes?

no
* Closes: #37299

Authored-by: light-city <455954986@qq.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
Light-City committed Aug 22, 2023
1 parent faa4652 commit b3936b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/cmake_modules/FindClangTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ else()
endif()

find_clang_tool(clang-format CLANG_FORMAT_BIN
"^clang-format version ${ARROW_CLANG_TOOLS_VERSION_ESCAPED}")
"clang-format version ${ARROW_CLANG_TOOLS_VERSION_ESCAPED}")
if(CLANG_FORMAT_BIN)
set(CLANG_FORMAT_FOUND 1)
message(STATUS "clang-format found at ${CLANG_FORMAT_BIN}")
Expand Down

0 comments on commit b3936b9

Please sign in to comment.