Skip to content

Commit

Permalink
[VL] Fix clang-format version (apache#5650)
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE authored May 8, 2024
1 parent c9018cd commit 18a9151
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dev/formatcppcode.sh
Original file line number Diff line number Diff line change
@@ -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 {} \;
2 changes: 1 addition & 1 deletion docs/developers/CppCodingStyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/developers/NewToGluten.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
```

Expand Down

0 comments on commit 18a9151

Please sign in to comment.