---
Language: Cpp
BasedOnStyle: LLVM

# Indentation
IndentWidth: 2
TabWidth: 2
UseTab: Never
ContinuationIndentWidth: 2
IndentCaseLabels: true

# Line length
ColumnLimit: 100

# Braces (Allman style — opening brace on its own line)
BreakBeforeBraces: Custom
BraceWrapping:
  AfterCaseLabel: false
  AfterClass: true
  AfterControlStatement: Always
  AfterEnum: true
  AfterFunction: true
  AfterNamespace: true
  AfterStruct: true
  AfterUnion: true
  BeforeCatch: true
  BeforeElse: true
  IndentBraces: false
  SplitEmptyFunction: false
  SplitEmptyRecord: false
  SplitEmptyNamespace: false

# Pointer / reference — middle spacing (int * p, not int* p or int *p)
PointerAlignment: Middle
ReferenceAlignment: Middle

# Spaces
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: Never
SpacesInContainerLiterals: false
SpacesInParentheses: false

# Return type on its own line for top-level definitions
AlwaysBreakAfterReturnType: TopLevelDefinitions

# Template declarations break to their own line
AlwaysBreakTemplateDeclarations: Yes

# Constructor initialiser lists
BreakConstructorInitializers: BeforeColon
ConstructorInitializerIndentWidth: 2

# Short constructs
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false

# Argument / parameter packing
AlignAfterOpenBracket: Align
BinPackArguments: false
BinPackParameters: false

# Alignment
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignOperands: Align
AlignTrailingComments: true

# Includes — preserve user ordering
SortIncludes: Never
IncludeBlocks: Preserve

# Blank lines
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: false
