Skip to content

Commit

Permalink
Merge pull request #3337 from jcking/clang-format
Browse files Browse the repository at this point in the history
Add .clang-format file to ensure consistent style of C++
  • Loading branch information
parrt authored Dec 7, 2021
2 parents 3cf70fc + 709dcfb commit 4318037
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .clang-format
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

0 comments on commit 4318037

Please sign in to comment.