---
# Based on LLVM style with customizations for ALE codebase
BasedOnStyle: LLVM

# Language settings
Language: Cpp
Standard: c++17

# Indentation
IndentWidth: 2
TabWidth: 2
UseTab: Never
AccessModifierOffset: -2
NamespaceIndentation: None

# Line length
ColumnLimit: 80

# Braces
BreakBeforeBraces: Attach

# Pointers and references
DerivePointerAlignment: false
PointerAlignment: Left

# Includes - automatically sorts and groups includes
SortIncludes: CaseInsensitive
IncludeBlocks: Regroup
IncludeCategories:
  # Main header (e.g., YarsRevenge.cpp includes YarsRevenge.hpp first)
  - Regex:           '^"ale/games/supported/.*\.hpp"'
    Priority:        1
  - Regex:           '^"ale/.*\.hpp"'
    Priority:        1
  # Project headers (ale/...)
  - Regex:           '^"ale/'
    Priority:        2
  # Third-party headers (stella, SDL, etc.)
  - Regex:           '^<(stella|SDL)/'
    Priority:        3
  # Standard library headers
  - Regex:           '^<.*'
    Priority:        4
IncludeIsMainRegex: '([-_](test|unittest))?$'

# Comments
ReflowComments: true
SpacesBeforeTrailingComments: 2

# Alignment
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignOperands: Align

# Function declarations/calls
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
BinPackArguments: true
BinPackParameters: true

# Penalties (lower = preferred)
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60

# Other settings
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
