Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .clang-format file to ensure consistent style of C++ #3337

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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