---
# Fincept Terminal — clang-format configuration
# Based on existing codebase style (K&R braces, 4-space indent, type-attached pointers)
Language: Cpp
BasedOnStyle: LLVM

# Indentation
IndentWidth: 4
TabWidth: 4
UseTab: Never
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentPPDirectives: AfterHash

# Column limit
ColumnLimit: 120

# Braces — same line (K&R style)
BreakBeforeBraces: Attach
BraceWrapping:
  AfterClass: false
  AfterControlStatement: false
  AfterEnum: false
  AfterFunction: false
  AfterNamespace: false
  AfterStruct: false
  AfterUnion: false
  BeforeCatch: false
  BeforeElse: false

# Pointer / reference binding to type
PointerAlignment: Left
ReferenceAlignment: Left

# Includes
IncludeBlocks: Regroup
IncludeCategories:
  # Local project headers (double quotes)
  - Regex: '^"'
    Priority: 1
  # Qt headers
  - Regex: '^<Q'
    Priority: 2
  # Standard library
  - Regex: '^<'
    Priority: 3
SortIncludes: CaseSensitive

# Spacing
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpaceAfterCStyleCast: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
SpaceBeforeCpp11BracedList: false
SpaceAfterTemplateKeyword: true
SpacesInAngles: Never

# Line breaks
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortLambdasOnASingleLine: All
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
PackConstructorInitializers: NextLine

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

# Misc
Cpp11BracedListStyle: true
FixNamespaceComments: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ReflowComments: true
SortUsingDeclarations: true
Standard: c++20
