-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy path.clang-format
209 lines (162 loc) · 5.38 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
---
# default tab width for all files
IndentWidth: 4
TabWidth: 4
---
# specifics for C
Language: Cpp
# N/A to C
AccessModifierOffset: -2
# allignments
# horizontally aligns long list of arguments after an open bracket
AlignAfterOpenBracket: Align
# initialization for an array of structs aligns the fields into columns
# AlignArrayOfStructures: Right
AlignConsecutiveAssignments: AcrossComments
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments
AlignConsecutiveMacros: AcrossComments
AlignEscapedNewlines: Left
# horizontally align operands of binary and ternary expressions
AlignOperands: Align
# aligns trailing comments.
AlignTrailingComments: true
# If a function call or braced initializer list doesn't fit on a line, break all arguments onto seperate lines
AllowAllArgumentsOnNextLine: false
# deprecated
AllowAllConstructorInitializersOnNextLine: false
# If a function call or braced initializer list doesn't fit on a line, break all arguments onto seperate lines
AllowAllParametersOfDeclarationOnNextLine: false
# allman even short blocks
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
# allman even short blocks except for empty (eg stubs stay on one line like chrGetNumArghs(){} )
AllowShortFunctionsOnASingleLine: Empty
# allman should be used, but if no brace supplied dont break
AllowShortIfStatementsOnASingleLine: WithoutElse
# N/A C however Merge all lambdas fitting on a single line
AllowShortLambdasOnASingleLine: All
# allman should be used, but if no brace supplied dont break
AllowShortLoopsOnASingleLine: true
# deprecated
AlwaysBreakAfterDefinitionReturnType: None
# no extra breaks after return
AlwaysBreakAfterReturnType: None
# keep blocks of strings together and indented +1 rather than indented + var length
AlwaysBreakBeforeMultilineStrings: true
# N/A to C
AlwaysBreakTemplateDeclarations: No
#
# AttributeMacros:
# if args broken, place each on new line
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakAfterJavaFieldAnnotations: true
# break after opperator and allign
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
# ternary operators will be placed after line breaks.
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
# break and align strings that are too long
BreakStringLiterals: true
# dont arbitarelly cut lines off at col 80
ColumnLimit: 0
CompactNamespaces: false
# deprecated
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
# use specified line ending and pointer allignment
DeriveLineEnding: false
DerivePointerAlignment: false
DisableFormat: false
# EmptyLineAfterAccessModifier: Never
# EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
# adds missing namespace end comments for short namespaces and fixes invalid existing ones.
FixNamespaceComments: true
# A vector of macros that should be interpreted as controls instead of as function calls.
ForEachMacros: ['FOREACH', 'BOOST_FOREACH']
# IfMacros: ['IF', 'IF_ELSE']
# dont resort includes
IncludeBlocks: Preserve
IncludeCategories:
- Regex: ^"(llvm|llvm-c|clang|clang-c)/
Priority: 2
- Regex: ^(<|"(gtest|gmock|isl|json)/)
Priority: 3
- Regex: .*
Priority: 1
IncludeIsMainRegex: (Test)?$
# indents
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: false
IndentPPDirectives: AfterHash
IndentWrappedFunctionNames: true
# remove empty lines
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
MacroBlockBegin: "#pragma region"
MacroBlockEnd : "#pragma endregion"
NamespaceIndentation: None
# pointer is each variable not type so stick * to variable
PointerAlignment: Right
DerivePointerAlignment: false
#ReferenceAlignment: Pointer
# qualifier should be left of type (volatile int)
# QualifierAlignment: Left
ReflowComments: true
# includes are sorted in an ASCIIbetical or case insensitive fashion
SortIncludes: true
SortUsingDeclarations: true
# spacings
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAroundPointerQualifiers: After
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement : false
SpacesInContainerLiterals : false
# SpacesInLineCommentPrefix : 1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
TypenameMacros: ['BITFLAG']
UseTab: Never
WhitespaceSensitiveMacros : ['BOOST_PP_STRINGIZE']
...