-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.clang-format
89 lines (81 loc) · 2.53 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# initial attempt at a clang-format reflow of the C74 code base
# there are a couple of things which aren't currently ideal:
# - the InsertBraces commands isn't available yet (on macOS at least), requires clang-format 15
# - there are some oddnesses with line comments, where the number of spaces post-comment isn't
# properly enforced due to the use of tab characters.
# some of this stuff might be possible with clang-tidy (part of LLVM, can't be installed separately)
# or with Uncrustify, if we decide to use that instead. Otherwise, this is a pretty strong basis to start with
---
BasedOnStyle: LLVM
IndentWidth: 4
IndentAccessModifiers: false
ColumnLimit: 0
#ContinuationIndentWidth: 4
#TabWidth: 4
#UseTab: ForContinuationAndIndentation
---
Language: Cpp
DerivePointerAlignment: false
PointerAlignment: Left
Cpp11BracedListStyle: false
BreakBeforeBinaryOperators: NonAssignment
IndentCaseLabels: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortFunctionsOnASingleLine: Inline
SortIncludes: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterCaseLabel: true
AfterControlStatement: MultiLine
AfterEnum: true
AfterFunction: true
AfterStruct: true
AfterUnion: true
BeforeElse: true
SplitEmptyRecord: false
SplitEmptyNamespace: false
SplitEmptyFunction: true
BreakInheritanceList: BeforeComma
BreakConstructorInitializers: BeforeComma
InsertBraces: true # need to wait for clang-format v15
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: 1
PackConstructorInitializers: CurrentLine
---
Language: ObjC
DerivePointerAlignment: false
PointerAlignment: Left
Cpp11BracedListStyle: false
BreakBeforeBinaryOperators: NonAssignment
IndentCaseLabels: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortFunctionsOnASingleLine: Inline
SortIncludes: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterCaseLabel: true
AfterControlStatement: MultiLine
AfterEnum: true
AfterFunction: true
AfterStruct: true
AfterUnion: true
BeforeElse: true
SplitEmptyRecord: false
SplitEmptyNamespace: false
SplitEmptyFunction: true
BreakInheritanceList: BeforeComma
BreakConstructorInitializers: BeforeComma
InsertBraces: true # need to wait for clang-format v15
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: 1
PackConstructorInitializers: CurrentLine