# LUNOPT's C++ formatting (clang-format 22).
# Allman braces; spaces inside parentheses, angle brackets and braced lists.
BasedOnStyle: LLVM
Language: Cpp
Standard: Latest
IndentWidth: 4
ColumnLimit: 120
PointerAlignment: Left
BreakBeforeBraces: Allman
AccessModifierOffset: -4
SpacesInParens: Custom
SpacesInParensOptions:
  InConditionalStatements: true
  Other: true
  InEmptyParentheses: false
  InCStyleCasts: false
SpacesInAngles: Always
SpaceAfterTemplateKeyword: false
Cpp11BracedListStyle: false
AlignAfterOpenBracket: AlwaysBreak
PenaltyReturnTypeOnItsOwnLine: 1000
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: BeforeComma
NamespaceIndentation: None
FixNamespaceComments: true
SpacesBeforeTrailingComments: 1
IncludeBlocks: Regroup
IncludeCategories:
  - Regex: '^<[a-z_]+>$'          # standard library
    Priority: 1
  - Regex: '^<'                    # third party
    Priority: 2
  - Regex: '^"lunopt/'             # LUNOPT's own
    Priority: 3
  - Regex: '.*'
    Priority: 4
