-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
233 lines (230 loc) · 9.18 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
231
232
233
BasedOnStyle: Microsoft
Language: Cpp
#ColumnLimit: 120
BraceWrapping:
# class definition behind
AfterClass: false
# After the control statement
AfterControlStatement: false
# enum definition behind
AfterEnum: true
# After the function definition
AfterFunction: false
# After the namespace definition
AfterNamespace: false
# ObjC definition behind
AfterObjCDeclaration: false
# struct definition behind
AfterStruct: false
# union definition
AfterUnion: false
#ExternBlock definition behind
AfterExternBlock: false
# before catch
BeforeCatch: false
# else before
BeforeElse: false
# Indented braces
IndentBraces: false
# Split empty function
SplitEmptyFunction: true
# Split empty records
SplitEmptyRecord: true
# Split empty namespace
SplitEmptyNamespace: true
# Add a space after @property, \@property (readonly) instead of \@property(readonly).
ObjCSpaceAfterProperty: true
# Offset of access specifiers (public, private, etc.)
AccessModifierOffset: -4
IndentAccessModifiers: false
# Alignment after opening brackets (opening parentheses, opening angle brackets, opening square brackets): Align, DontAlign, AlwaysBreak (always wrap after opening brackets)
AlignAfterOpenBracket: Align
# When assigning consecutively, align all equal signs
AlignConsecutiveAssignments: false
# When consecutive declarations, align all declared variable names
AlignConsecutiveDeclarations: true
# Left align backslashes that escape newlines (use backslashes for newlines)
AlignEscapedNewlinesLeft: true
# Align the operands of binary and ternary expressions horizontally
AlignOperands: true
# Align consecutive trailing comments
AlignTrailingComments: true
# Allow all parameters of the function declaration to be placed on the next line
AllowAllParametersOfDeclarationOnNextLine: true
# Allow short blocks on the same line
AllowShortBlocksOnASingleLine: false
# Allow short case labels on the same line
AllowShortCaseLabelsOnASingleLine: false
# Allow short functions to be placed on the same line: None, InlineOnly (defined in the class), Empty (empty function), Inline (defined in the class, empty function), All
AllowShortFunctionsOnASingleLine: Inline
# Allow short if statements to stay on the same line
AllowShortIfStatementsOnASingleLine: false
# Allow short loops to stay on the same line
AllowShortLoopsOnASingleLine: false
# Always break after defining the return type (deprecated)
AlwaysBreakAfterDefinitionReturnType: None
# Always wrap after the return type: None, All, TopLevel (top functions, functions not included in the class),
# AllDefinitions (all definitions, excluding declarations), TopLevelDefinitions (the definitions of all top-level functions)
AlwaysBreakAfterReturnType: None
# Always wrap before multi-line string literal
AlwaysBreakBeforeMultilineStrings: false
# Always wrap after the template statement
AlwaysBreakTemplateDeclarations: false
# false means that the function arguments are either on the same line or on their own line
BinPackArguments: true
# false means that all formal parameters are either on the same line or on their own line
BinPackParameters: true
# Braces wrap, only valid when BreakBeforeBraces is set to Custom
# Newline before binary operators: None (newline after the operator), NonAssignment (newline before the non-assignment operator), All (newline before the operator)
BreakBeforeBinaryOperators: NonAssignment
# Wrap a line before the brace: Attach (always attach the brace to the surrounding context), Linux (except for functions, namespaces and class definitions, similar to Attach),
# Mozilla (except enumeration, function, record definition, similar to Attach), Stroustrup (except function definition, catch, else, similar to Attach),
# Allman (always break before the curly brace), GNU (always break before the curly brace, and add extra indentation to the curly brace of the control statement), WebKit (newline before the function), Custom
# Note: It is considered that the statement block also belongs to the function
BreakBeforeBraces: Allman
# Break before ternary operator
BreakBeforeTernaryOperators: true
# Break before the comma in the initialization list of the constructor
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
EmptyLineAfterAccessModifier: Leave
# Describe the regular expression of the comment with special meaning, it should not be divided into multiple lines or changed in other ways
# CommentPragmas:'^ IWYU pragma:'
# The initialization list of the constructor is either all on the same line or on their own line
AllowAllConstructorInitializersOnNextLine: true
# The indentation width of the initialization list of the constructor
ConstructorInitializerIndentWidth: 4
# The indentation width of the continued line
ContinuationIndentWidth: 4
# Remove the space before the curly braces {after and before the C++11 list initialization
Cpp11BracedListStyle: true
# Inherit the most commonly used pointer and reference alignment
DerivePointerAlignment: false
# Turn off formatting
DisableFormat: false
# Automatically detect whether the function call and definition are formatted as one parameter per line (Experimental)
ExperimentalAutoDetectBinPacking: false
# Fix namespace comment
FixNamespaceComments: true
# Need to be interpreted as a foreach loop instead of a function call macro
# ForEachMacros:
# -foreach
# -Q_FOREACH
# -BOOST_FOREACH
# Sort #include, #include that matches a regular expression has a corresponding priority, and the default priority is INT_MAX (the smaller the priority, the higher the priority),
# You can define a negative priority to ensure that certain #include is always at the top
# IncludeCategories:
# -Regex:'^<ext/.*\.h>'
# Priority: 2
# -Regex:'^<.*\.h>'
# Priority: 1
# -Regex:'^<.*'
# Priority: 2
# -Regex:'.*'
# Priority: 3
# IncludeIsMainRegex:'([-_](test|unittest))?$'
# Indent case label
IndentCaseLabels: true
# Indentation width
IndentWidth: 4
# When the function return type wraps, indent the function declaration or the function name of the function definition
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
# Keep the blank line at the beginning of the block
KeepEmptyLinesAtTheStartOfBlocks: true
# The regular expression of a macro to start a block
# MacroBlockBegin:''
# End the regular expression of a block macro
#MacroBlockEnd:''
# Maximum number of consecutive blank lines
MaxEmptyLinesToKeep: 1
# Namespace indentation: None, Inner (indent the content in the nested namespace), All
NamespaceIndentation: None
# Indent width when using ObjC block
ObjCBlockIndentWidth: 4
# Add a space before ObjC's protocol list
ObjCSpaceBeforeProtocolList: false
# Penalty that wraps the function call after call(
PenaltyBreakBeforeFirstCallParameter: 19
# Introduce a penalty for line breaks in a comment
PenaltyBreakComment: 300
# The penalty for the first line break before <<
PenaltyBreakFirstLessLess: 120
# Introduce a penalty for line breaks in a string literal
PenaltyBreakString: 1000
# Penalty for each character outside the line character limit
PenaltyExcessCharacter: 1000000
# Put the return type of the function in the penalty of its own line
PenaltyReturnTypeOnItsOwnLine: 60
# Alignment of pointer and reference: Left, Right, Middle
PointerAlignment: Left
# RawStringFormats:
# -Language: Cpp
# Delimiters:
# -cc
# -CC
# -cpp
# -Cpp
# -CPP
# -'c++'
# -'C++'
# CanonicalDelimiter:''
# BasedOnStyle: google
# -Language: TextProto
# Delimiters:
# -pb
# -PB
# -proto
# -PROTO
# EnclosingFunctions:
# -EqualsProto
# -EquivToProto
# -PARSE_PARTIAL_TEXT_PROTO
# -PARSE_TEST_PROTO
# -PARSE_TEXT_PROTO
# -ParseTextOrDie
# -ParseTextProtoOrDie
# CanonicalDelimiter:''
# BasedOnStyle: google
# Allow retypesetting comments
ReflowComments: true
# Allow sorting#include
SortIncludes: true
SortUsingDeclarations: true
# Add space after C style type conversion
SpaceAfterCStyleCast: false
# Add a space before the assignment operator
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
# Add a space before opening the parentheses: Never, ControlStatements, Always
SpaceBeforeParens: Never
SpacesInParens: Custom
SpacesInParensOptions:
# ExceptDoubleParentheses: true
InConditionalStatements: true
InEmptyParentheses: false
InCStyleCasts: false
Other: true
# The number of spaces added before trailing comments (only applicable to //)
SpacesBeforeTrailingComments: 2
# Add spaces before and after the angle brackets
SpacesInAngles: Always
# Add spaces in the literal of the container (ObjC and JavaScript arrays and dictionaries, etc.)
SpacesInContainerLiterals: true
# Add spaces in the brackets of C-style type conversion
SpacesInCStyleCastParentheses: false
# Add a space before the (after and) of the parentheses
SpacesInParentheses: false
# Add a space before the [after and] of the square brackets, the declaration of lamda expressions and arrays of unspecified size will not be affected
SpacesInSquareBrackets: true
# Standard: Cpp03, Cpp11, Auto
Standard: Cpp11
# tab width
TabWidth: 4
# Use tab characters: Never, ForIndentation, ForContinuationAndIndentation, Always
UseTab: Never