Language: Cpp
Standard: Latest
BasedOnStyle: Google

# Layout (Google defaults, spelled out)
UseTab: Never
IndentWidth: 2
ContinuationIndentWidth: 4
ColumnLimit: 80
AccessModifierOffset: -1
BreakBeforeBraces: Attach
IndentCaseLabels: true
BreakConstructorInitializers: BeforeColon
ConstructorInitializerIndentWidth: 4
PackConstructorInitializers: NextLine
SpacesBeforeTrailingComments: 2
IndentPPDirectives: AfterHash
PPIndentWidth: 2

# Project choices on top of Google
NamespaceIndentation: All
FixNamespaceComments: true
InsertBraces: true
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: InlineOnly
DerivePointerAlignment: false
PointerAlignment: Left
ReferenceAlignment: Pointer
QualifierAlignment: Left
MaxEmptyLinesToKeep: 1

# Includes: pch, own header, project, vendor, standard library
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeCategories:
  - Regex: '^"[a-z]+pch\.h"$'     # precompiled header, always first
    Priority: -1
  - Regex: '^<[a-z_]+>$'           # standard library
    Priority: 5
  - Regex: '^<.*>$'                # vendor
    Priority: 4
  - Regex: '^".*"$'                # project
    Priority: 3
