-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.clang-format
230 lines (185 loc) · 6.92 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
Language: Cpp
Standard: Auto
UseTab: Never
IndentWidth: 4
TabWidth: 4
AccessModifierOffset: -4
AlignAfterOpenBracket: Align # DontAlign AlwaysBreak BlockIndent
AlignArrayOfStructures: Left
# AlignConsecutiveAssignments: # None Consecutive AcrossEmptyLines AcrossComments AcrossEmptyLinesAndComments -> select one of them or use the options below
# Enabled: true
# AcrossEmptyLines: true
# AcrossComments: true
# AlignCompound: false
# PadOperators: false
# AlignConsecutiveBitFields:
# Enabled: true
# AcrossEmptyLines: true
# AcrossComments: false
# AlignConsecutiveDeclarations:
# Enabled: true
# AcrossEmptyLines: true
# AcrossComments: false
# AlignFunctionPointers: false
# AlignConsecutiveMacros:
# Enabled: true
# AcrossEmptyLines: true
# AcrossComments: false
# AlignConsecutiveShortCaseStatements:
# Enabled: true
# AcrossEmptyLines: true
# AcrossComments: false
# AlignCaseColons: false
# AlignEscapedNewlines: DontAlign # Left Right
AlignOperands: Align # DontAlign AlignAfterOperator
# AlignTrailingComments:
# Kind: Always Never Leave
# OverEmptyLines: 2
# AllowAllConstructorInitializersOnNextLine: true # deprecated, use PackConstructorInitializers
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
# AllowBreakBeforeNoexceptSpecifier: Never OnlyWithParen Always
## Short definitions on single line
AllowShortBlocksOnASingleLine: Never # Empty Always
AllowShortCaseLabelsOnASingleLine: false
# AllowShortCompoundRequirementOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None # InlineOnly Empty Inline All
AllowShortIfStatementsOnASingleLine: Never # WithoutElse OnlyFirstIf AllIfsAndElse
AllowShortLambdasOnASingleLine: None # Empty Inline All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None # All TopLevel
AlwaysBreakAfterReturnType: None # All TopLevel AllDefinitions TopLevelDefinitions
# AlwaysBreakBeforeMultilineStrings: false vs BreakStringLiterals -> change or remove one of them
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: After # Both None Before
BraceWrapping:
AfterClass: true
AfterControlStatement: Always # Never MultiLine
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: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
# BracedInitializerIndentWidth: 2
# BreakAdjacentStringLiterals: true
# BreakAfterAttributes: Never # Always Leave
# BreakArrays: true
BreakBeforeBinaryOperators: None # NonAssignment All
BreakBeforeBraces: Custom # Attach Linux Mozilla Stroustrup Allman Whitesmiths GNU WebKit
# BreakBeforeConceptDeclarations: Allowed # Never Always
# BreakBeforeInlineASMColon: OnlyMultiLine # Never Always
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon # BeforeColon BeforeComma
BreakInheritanceList: BeforeColon # BeforeComma AfterColon AfterComma
BreakStringLiterals: true
ColumnLimit: 150
# CommentPragmas: '^ IWYU pragma:'
# CompactNamespaces: false
# ConstructorInitializerAllOnOneLineOrOnePerLine: true # deprecated use PackConstructorInitializers
# ConstructorInitializerIndentWidth: -4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
# ExperimentalAutoDetectBinPacking: false
EmptyLineAfterAccessModifier: Never # Always Leave
EmptyLineBeforeAccessModifier: Never # Always Leave
FixNamespaceComments: true
# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
# IfMacros: [ if, ifdef, ifndef ]
IncludeBlocks: Regroup # Preserve Merge
# IncludeCategories:
# - Regex: '^<.*\.h>'
# Priority: 2
# - Regex: '^<.*'
# Priority: 1
# - Regex: '.*'
# Priority: 0
# IncludeIsMainRegex: '([Mm]ain|[Tt]est)$'
# IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: false
# IndentExternBlock: AfterExternBlock # NoIndent Indent -> BraceWrapping.AfterExternBlock
IndentGotoLabels: false
IndentPPDirectives: None # AfterHash BeforeHash
# IndentRequiresClause: false
IndentWrappedFunctionNames: true
# JavaScriptQuotes: Leave Single Double
# JavaScriptWrapImports: true
# InsertBraces: true -> safer to do manually
InsertNewlineAtEOF: true
InsertTrailingCommas: None # Wrapped
# IntegerLiteralSeperator:
KeepEmptyLinesAtEOF: false
KeepEmptyLinesAtTheStartOfBlocks: false
# LambdaBodyIndentation: Signature OuterScope
LineEnding: CRLF # LF DeriveLF DeriveCRLF
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None # Inner All
# ObjCBinPackProtocolList: Always # Never Auto
# ObjCBlockIndentWidth: 2
# ObjCSpaceAfterProperty: true
# ObjCSpaceBeforeProtocolList: true
# PPIndentWidth: 0 -> IndentPPDirectives: None
PackConstructorInitializers: Never # BinPack CurrentLine NextLine NextLineOnly
### Penalties, used to make clang decide between two equally good formatting options, clang will choose the one with the lower penalty
# PenaltyBreakAssignment: 0
# PenaltyBreakBeforeFirstCallParameter: 0
# PenaltyBreakComment: 0
# PenaltyBreakFirstLessLess: 0
# PenaltyBreakOpenParentheses: 0
# PenaltyBreakScopeResolution: 0
# PenaltyBreakString: 0
# PenaltyBreakTemplateDeclaration: 0
# PenaltyExcessCharacter: 0
# PenaltyIndentedWhitespace: 0
# PenaltyReturnTypeOnItsOwnLine: 0
PointerAlignment: Left # Right Middle
ReferenceAlignment: Pointer # Right Middle
QualifierAlignment: Leave # Left Right Custom
# QualifierOrder: [ 'static', 'const', 'constexpr', 'inline', 'type', 'friend', 'volatile', 'restrict' ] # 'type' must be in the list
ReflowComments: true
# RemoveBracesLLVM: true # -> not safe
# RemoveParentheses: true # -> not safe
# RemoveSemicolon: true # -> not safe
# RequiresClausePosition: # OwnLine WithPreceding WithFollowing SingleLine
# RequiresExpressionIndentation: # OuterScope Keyword
SeparateDefinitionBlocks: Always # Never Leave
ShortNamespaceLines: 0
SortIncludes: CaseSensitive # CaseInsensitive Never
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Default # Before After Both
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeJsonColon: true
SpaceBeforeParens: ControlStatements # Never ControlStatementsExceptControlMacros NonEmptyParentheses Always Custom
# SpaceBeforeParensOptions # if custom
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpacesBeforeTrailingComments: 3
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false # deprecated
SpacesInConditionalStatement: false # deprecated
SpacesInContainerLiterals: false
SpacesInParentheses: false # deprecated
SpacesInSquareBrackets: false