Skip to content

Commit 709dcfb

Browse files
committed
Add .clang-format file to ensure consistent style of C++
1 parent 0802afb commit 709dcfb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.clang-format

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
# This section defines defaults for all languages. Currently we derive ANTLR style from LLVM.
3+
BasedOnStyle: LLVM
4+
# Only use clang-format for C++ for now.
5+
DisableFormat: true
6+
7+
---
8+
# This section configures C++ formatting.
9+
Language: Cpp
10+
DisableFormat: false
11+
Standard: c++17
12+
# Prevent clang-format from attempting to pick the alignment and always use right alignment.
13+
DerivePointerAlignment: false
14+
# ANTLR existing style is to right align pointers and references.
15+
PointerAlignment: Right
16+
ReferenceAlignment: Right
17+
# Some of ANTLR existing code is longer than the default 80, so use 100 for now.
18+
ColumnLimit: 100
19+
# Historically ANTLR has used indentation within namespaces, so replicate it.
20+
NamespaceIndentation: Inner

0 commit comments

Comments
 (0)