how to put multiple languages settings in a single .clang-format file

Viewed 1206

I want to make a single .clang-format for: java, javascript and c++. I know how to dump example configurations for a single language but dont't know how to merge those 3 config files.

1 Answers

Example on how to put multiple language configurations in a single file:

---
BasedOnStyle: LLVM
IndentWidth: 4
---
Language: Cpp
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Left
---
Language: JavaScript
# Use 100 columns for JS.
ColumnLimit: 100
---
Language: Proto
# Don't format .proto files.
DisableFormat: true
---
Language: CSharp
# Use 100 columns for C#.
ColumnLimit: 100
...
Related