# clang-format configuration for DBAL C++ project
# Based on Google C++ Style Guide with minor modifications

# Base style
BasedOnStyle: Google

# Language
Language: Cpp
Standard: c++17

# Indentation
IndentWidth: 4
TabWidth: 4
UseTab: Never
NamespaceIndentation: None

# Line length
ColumnLimit: 100

# Braces
BreakBeforeBraces: Attach

# Pointers and references
DerivePointerAlignment: false
PointerAlignment: Left

# Include sorting
SortIncludes: CaseInsensitive
IncludeBlocks: Regroup

# Comments
ReflowComments: true
SpacesBeforeTrailingComments: 2

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

# Function parameters
AllowAllParametersOfDeclarationOnNextLine: true
BinPackParameters: false

# Penalties (for line breaking decisions)
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60

# Other
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
