-
Notifications
You must be signed in to change notification settings - Fork 97
/
.clang-format
37 lines (30 loc) · 1.1 KB
/
.clang-format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This would ideally be the entire file
BasedOnStyle: GNU
# Names etc get rather long
ColumnLimit: 120
# Used for doc strings
ReflowComments: false
# To get C99 initializers to be one per line, the last item must have
# a trailing comma. There is no setting.
# CPython macros that have the trailing comma/semi-colon as part of
# the macro.
StatementMacros: ["PyObject_HEAD", "PyVarObject_HEAD_INIT"]
# PyVarObject_HEAD_INIT should be part of above, but doesn't work
# (needs clang-format 17) so until then clang-format off/on needs to
# be placed around it, and still messes up the next member
# GNU annoyingly indents braces, which takes a whole bunch of settings
# to undo when you'd expect IndentBraces: false to be sufficient
BreakBeforeBraces: Custom
BraceWrapping:
IndentBraces: false
AfterCaseLabel: false
AfterControlStatement: Always
AfterStruct: true
AfterEnum: true
AfterUnion: true
BeforeElse: true
BeforeWhile: false
AfterFunction: true
SplitEmptyFunction: true
# We don't need lots of additional white space, except this is nice
SpaceBeforeParens: ControlStatements