---
BasedOnStyle: Google
UseTab: Never
IndentWidth: 4
ContinuationIndentWidth: 4
AccessModifierOffset: -4
ColumnLimit: 100

Language: Cpp
Standard: c++17
AlignAfterOpenBracket: Align
AlignEscapedNewlines: Right
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: Never
BinPackArguments: false
BinPackParameters: OnePerLine
BreakBeforeTernaryOperators: true
CommentPragmas: 'NOLINT(NEXTLINE|BEGIN|END)?\[.*\]'
DerivePointerAlignment: false
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
  - Regex: '^[<"]Python\.h[">]$'
    Priority: 2
    CaseSensitive: true
  - Regex: '^[<"]pybind11/.*[">]$'
    Priority: 3
    CaseSensitive: true
  - Regex: '^<[[:alnum:]_/]+(\.h)?>$'
    Priority: 1
  - Regex: '^"optree/'
    Priority: 4
    CaseSensitive: true
  - Regex: ".*"
    Priority: 5
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentPPDirectives: AfterHash
InsertBraces: true
InsertTrailingCommas: Wrapped
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: '^Py_BEGIN_(ALLOW_THREADS|CRITICAL_SECTION(2)?(_MUT)?)$'
MacroBlockEnd: '^Py_END_(ALLOW_THREADS|CRITICAL_SECTION(2)?(_MUT)?)$'
PackConstructorInitializers: NextLine
PointerAlignment: Right
QualifierAlignment: Custom
QualifierOrder:
  [friend, static, inline, const, constexpr, volatile, type, restrict]
ReferenceAlignment: Right
RemoveParentheses: ReturnStatement
RemoveSemicolon: true
SeparateDefinitionBlocks: Leave
SkipMacroDefinitionBody: false
SortIncludes:
  Enabled: true
  IgnoreCase: false
SpaceAroundPointerQualifiers: Both
StatementAttributeLikeMacros:
  - Py_ALWAYS_INLINE
  - Py_NO_INLINE
