# Native C++20 style for src/ and tests/. decomp/ has its own file.
# Pinned formatter: tools/requirements-format.txt; run tools/format_sources.py.
BasedOnStyle: LLVM
Language: Cpp
Standard: c++20

IndentWidth: 4
ContinuationIndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 100
LineEnding: LF
InsertNewlineAtEOF: true

BreakBeforeBraces: Allman
InsertBraces: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseExpressionOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false

BinPackArguments: false
BinPackLongBracedList: false
BinPackParameters: OnePerLine
AlignAfterOpenBracket: false
BreakConstructorInitializers: BeforeComma
PackConstructorInitializers: Never

PointerAlignment: Left
ReferenceAlignment: Pointer
DerivePointerAlignment: false

SortIncludes:
  Enabled: true
  IgnoreCase: false
IncludeBlocks: Preserve
# Other Windows SDK headers expect <windows.h> to come first.
IncludeCategories:
  - Regex: '^<windows\.h>$'
    Priority: 1
  - Regex: '.*'
    Priority: 2
KeepEmptyLines:
  AtStartOfBlock: false
MaxEmptyLinesToKeep: 1
