# Clifft C++ formatting rules
# Based on Google style with minor adjustments

BasedOnStyle: Google
ColumnLimit: 100

# Indentation
IndentWidth: 4
ContinuationIndentWidth: 4
AccessModifierOffset: -2

# Braces
BreakBeforeBraces: Attach
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false

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

# Includes
IncludeBlocks: Regroup
IncludeCategories:
  # Clifft headers first
  - Regex: '^"clifft/'
    Priority: 1
  # Other local headers
  - Regex: '^"'
    Priority: 2
  # Stim headers
  - Regex: '^<stim'
    Priority: 3
  # System/standard headers
  - Regex: '^<'
    Priority: 4

# Pointers and references
PointerAlignment: Left
ReferenceAlignment: Left
DerivePointerAlignment: false

# Spaces
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

# Other
SortIncludes: true
ReflowComments: true
AllowAllParametersOfDeclarationOnNextLine: true
BinPackArguments: true
BinPackParameters: true
