---
# Based on LLVM style: only deliberate deviations are listed.
Language: Cpp
BasedOnStyle: LLVM
Standard: c++17

# Indentation
IndentWidth: 4
TabWidth: 4
UseTab: Never
ContinuationIndentWidth: 4
AccessModifierOffset: -4
NamespaceIndentation: All

ColumnLimit: 140

# A line that does not fit breaks right after the opening bracket and indents by
# ContinuationIndentWidth, instead of aligning under the bracket far to the right.
AlignAfterOpenBracket: AlwaysBreak

# Allman braces
BreakBeforeBraces: Custom
BraceWrapping:
  AfterCaseLabel: false
  AfterClass: true
  AfterControlStatement: Always
  AfterEnum: true
  AfterExternBlock: true
  AfterFunction: true
  AfterNamespace: true
  AfterStruct: true
  AfterUnion: true
  BeforeCatch: true
  BeforeElse: true
  BeforeLambdaBody: false
  BeforeWhile: false
  IndentBraces: false

# Nothing gets collapsed onto a single line
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
BreakTemplateDeclarations: MultiLine

# Pointer binds to the type: const char* p
DerivePointerAlignment: false
PointerAlignment: Left

# One initializer per line, comma first
PackConstructorInitializers: BinPack
BreakConstructorInitializers: BeforeComma

# Includes are sorted and regrouped by category
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
