# Configuration file for clang-format
BasedOnStyle: Google

AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignEscapedNewlines: LeftWithLastLine
AlignOperands: AlignAfterOperator
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
BraceWrapping:
  AfterCaseLabel: true
  AfterClass: true
  AfterControlStatement: Always
  AfterEnum: true
  AfterExternBlock: true
  AfterFunction: true
  AfterNamespace: true
  AfterObjCDeclaration: true
  AfterStruct: true
  AfterUnion: true
  BeforeCatch: true
  BeforeElse: true
  BeforeLambdaBody: true
  BeforeWhile: true
  SplitEmptyFunction: false
  SplitEmptyNamespace: false
  SplitEmptyRecord: false
BinPackArguments: true
BinPackLongBracedList: true
BinPackParameters: BinPack
BreakAfterJavaFieldAnnotations: true
BreakBeforeBraces: Custom
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
ColumnLimit: 120
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 4
DerivePointerAlignment: false
EmptyLineBeforeAccessModifier: Always
IncludeBlocks: Preserve
IndentAccessModifiers: false
IndentCaseLabels: false
IndentExternBlock: NoIndent
InsertBraces: false
InsertNewlineAtEOF: true
LambdaBodyIndentation: OuterScope
PackConstructorInitializers: CurrentLine
PointerAlignment: Middle
RemoveBracesLLVM: true
RemoveSemicolon: true
QualifierAlignment: Right
SpacesInContainerLiterals: false
Standard: Latest
TabWidth: 2

---
Language: Java
AllowShortFunctionsOnASingleLine: Empty
BraceWrapping:
  # Unlike C++, empty Java types stay multiline: clang-format 23.1.1 collapses
  # empty interfaces and records to {} with the inherited false, 23.1.0 does not.
  SplitEmptyRecord: true

---
Language: ObjC
# clang-format 20-23 parse a block literal with an angle-bracketed return type, e.g.
# ^NSDictionary<NSString *, NSString *> *(...) in libs/platform/http_uploader_apple.mm,
# as a function definition, so RemoveSemicolon deletes the ; that terminates it.
RemoveSemicolon: false
