# A clang-format style that approximates Python's PEP 7
# Useful for IDE integration
#
# Based on NumPy's version at
# https://github.com/numpy/numpy/blob/06cdc97dcdb78389026ce95fa136494954d2530e/.clang-format
BasedOnStyle: Google
AlignAfterOpenBracket: Align
AllowShortEnumsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AlwaysBreakAfterReturnType: TopLevel
BreakBeforeBraces: Stroustrup
ColumnLimit: 79
# A very lenient penalty, because line-breaking atrocities should be prevented.
PenaltyExcessCharacter: 5
ContinuationIndentWidth: 4
DerivePointerAlignment: false
IndentWidth: 4
IncludeBlocks: Regroup
IncludeCategories:
  - Regex:           '^[<"](Python|structmember|pymem)\.h'
    Priority:        -3
    CaseSensitive:   true
  - Regex:           '^"[[:alnum:]_.]+"'
    Priority:        1
  - Regex:           '^<[[:alnum:]_.]+"'
    Priority:        2
PointerAlignment: Right
ReflowComments: true
SpaceBeforeParens: ControlStatements
SpacesInParentheses: false
StatementMacros: [PyObject_HEAD, PyObject_VAR_HEAD, PyObject_HEAD_EXTRA]
TabWidth: 4
UseTab: Never
