From 18a915181c6816abb7295d03788fd2a4aadf56a4 Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Wed, 8 May 2024 16:25:02 +0800 Subject: [PATCH] [VL] Fix clang-format version (#5650) --- CONTRIBUTING.md | 2 +- dev/formatcppcode.sh | 4 ++-- docs/developers/CppCodingStyle.md | 2 +- docs/developers/NewToGluten.md | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9450191dd4cb..67a0f235ad8a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,7 +54,7 @@ Developer can import the code style setting to IDE and format Java/Scala code wi ##### C/C++ code style There are some code style conventions need to comply. See [CppCodingStyle.md](https://github.com/apache/incubator-gluten/blob/main/docs/developers/CppCodingStyle.md). -For Velox backend, developer can just execute `dev/formatcppcode.sh` to format C/C++ code. It requires `clang-format-12` +For Velox backend, developer can just execute `dev/formatcppcode.sh` to format C/C++ code. It requires `clang-format-15` installed in your development env. ### License Header diff --git a/dev/formatcppcode.sh b/dev/formatcppcode.sh index 93a6107bf0ac..d391235dac9d 100755 --- a/dev/formatcppcode.sh +++ b/dev/formatcppcode.sh @@ -1,3 +1,3 @@ cd `dirname $0` -find ../cpp/core -regex '.*\.\(cc\|hpp\|cu\|c\|h\)' -exec clang-format-12 -style=file -i {} \; -find ../cpp/velox -regex '.*\.\(cc\|hpp\|cu\|c\|h\)' -exec clang-format-12 -style=file -i {} \; +find ../cpp/core -regex '.*\.\(cc\|hpp\|cu\|c\|h\)' -exec clang-format-15 -style=file -i {} \; +find ../cpp/velox -regex '.*\.\(cc\|hpp\|cu\|c\|h\)' -exec clang-format-15 -style=file -i {} \; diff --git a/docs/developers/CppCodingStyle.md b/docs/developers/CppCodingStyle.md index 5b37c2cd5012..9dca4cf69fbc 100644 --- a/docs/developers/CppCodingStyle.md +++ b/docs/developers/CppCodingStyle.md @@ -30,7 +30,7 @@ Gluten CPP coding, there are a few Philosophical rules as the following. Many aspects of C++ coding style will be covered by clang-format, such as spacing, line width, indentation and ordering (for includes, using directives and etc).  -* Always ensure your code is compatible with clang-format-12 for Velox backend. +* Always ensure your code is compatible with clang-format-15 for Velox backend. * `dev/formatcppcode.sh` is provided for formatting Velox CPP code. ## Naming Conventions diff --git a/docs/developers/NewToGluten.md b/docs/developers/NewToGluten.md index b3f05a64b3e8..de0ea714bd9b 100644 --- a/docs/developers/NewToGluten.md +++ b/docs/developers/NewToGluten.md @@ -283,16 +283,16 @@ Search `update` in Manage->Settings to turn off update mode ### Clang format -Now gluten uses clang-format 12 to format source files. +Now gluten uses clang-format 15 to format source files. ```bash -apt-get install clang-format-12 +apt-get install clang-format-15 ``` Set config in `settings.json` ```json -"clang-format.executable": "clang-format-12", +"clang-format.executable": "clang-format-15", "editor.formatOnSave": true, ```