-
Notifications
You must be signed in to change notification settings - Fork 65
/
.clang-format
213 lines (207 loc) · 6.01 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
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# SPDX-FileCopyrightText: Copyright 2020 Micron Technology, Inc.
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveMacros: Consecutive
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands: DontAlign
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: TopLevel
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
# AttributeMacros only work wtih macros that do not take parameters.
# HSE attribute macros that take parameters work better as TypenameMacros
# because clang-format assumes they have parameters.
AttributeMacros:
- HSE_ALWAYS_INLINE
- HSE_COLD
- HSE_CONST
- HSE_HOT
- HSE_MAYBE_UNUSED
- HSE_NOINLINE
- HSE_NORETURN
- HSE_PACKED
- HSE_READ_MOSTLY
- HSE_RETURNS_NONNULL
- HSE_SENTINEL
- HSE_USED
- HSE_WARN_UNUSED_RESULT
- HSE_WEAK
# Treating function attribute macros that take parameters as TypenameMacros
# helps format function declarations that use them.
TypenameMacros:
- HSE_NONNULL
- HSE_PRINTF
- HSE_ALIGNED
ForEachMacros:
- cds_list_for_each
- cds_list_for_each_entry_rcu
- cds_list_for_each_entry_reverse
- cds_list_for_each_entry_safe
- cds_list_for_each_entry_safe_from
- cds_list_for_each_prev
- cds_list_for_each_prev_safe
- cds_list_for_each_safe
- cn_tree_foreach_leaf
- cn_tree_foreach_leaf_safe
- cn_tree_foreach_node
- kmc_chunk_foreach
- kmc_slab_foreach
- kmc_zone_foreach
- list_for_each
- list_for_each_entry
- list_for_each_entry_reverse
- list_for_each_entry_reverse_safe
- list_for_each_entry_safe
- rbtree_postorder_for_each_entry_safe
- s_list_for_each
- s_list_for_each_entry
- s_list_for_each_entry_safe
- s_list_for_each_safe
- STAILQ_FOREACH
- TAILQ_FOREACH
- TAILQ_FOREACH_REVERSE
BinPackArguments: true
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: MultiLine
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: AfterColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^[<"]build_config.h'
Priority: 1
- Regex: '^<hse/test/' # Test support
Priority: 13
- Regex: '^<hse/tools/' # Tool support
Priority: 12
- Regex: '^<hse/.+/' # Internal files
Priority: 11
- Regex: '^<hse/' # Public API files
Priority: 10
- Regex: '^"' # Local files
Priority: 20
- Regex: '^<.*/' # Non-HSE and System includes
Priority: 3
- Regex: '^<' # Non-HSE and System includes
Priority: 2
- Regex: '.' # Everything else
Priority: 100
# Seems to be no way to disable the "IncludeIsMain" settings,
# so we set them to patterns we don't expect to see.
IncludeIsMainRegex: 'XYZ'
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Right
ReflowComments: false
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatementsExceptControlMacros
SpaceAroundPointerQualifiers: Both
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
TabWidth: 4
UseCRLF: false
UseTab: Never
...