-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3337 from jcking/clang-format
Add .clang-format file to ensure consistent style of C++
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
# This section defines defaults for all languages. Currently we derive ANTLR style from LLVM. | ||
BasedOnStyle: LLVM | ||
# Only use clang-format for C++ for now. | ||
DisableFormat: true | ||
|
||
--- | ||
# This section configures C++ formatting. | ||
Language: Cpp | ||
DisableFormat: false | ||
Standard: c++17 | ||
# Prevent clang-format from attempting to pick the alignment and always use right alignment. | ||
DerivePointerAlignment: false | ||
# ANTLR existing style is to right align pointers and references. | ||
PointerAlignment: Right | ||
ReferenceAlignment: Right | ||
# Some of ANTLR existing code is longer than the default 80, so use 100 for now. | ||
ColumnLimit: 100 | ||
# Historically ANTLR has used indentation within namespaces, so replicate it. | ||
NamespaceIndentation: Inner |