-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-tidy
311 lines (311 loc) · 11.8 KB
/
.clang-tidy
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
Checks: '
clang-diagnostic-*,
clang-analyzer-*,
readability-*,
llvm-*,
darwin-*,
-readability-convert-member-functions-to-static,
'
CheckOptions:
########################################################################
# LLVM
########################################################################
- key: llvm-header-guard.HeaderFileExtensions
value: "h"
- key: llvm-namespace-comment
value: "ShortNamespaceLines"
########################################################################
# Darwin
########################################################################
- key: darwin-avoid-spinlock
value: true
- key: darwin-dispatch-once-nonstatic
value: true
########################################################################
# Readability
########################################################################
- key: readability-avoid-const-params-in-decls
value: true
- key: readability-braces-around-statements
value: true
- key: readability-const-return-type
value: true
- key: readability-container-contains
value: true
- key: readability-container-data-pointer
value: true
- key: readability-container-size-empty
value: true
- key: readability-delete-null-pointer
value: true
- key: readability-duplicate-include
value: true
- key: readability-else-after-return
value: true # FIXME: Symmetry also improves readibility.
########################################################################
# Readability - Function Cognitive Complexity Began
########################################################################
- key: readability-function-cognitive-complexity.Threshold
value: 25
- key: readability-function-cognitive-complexity.DescribeBasicIncrements
value: true
- key: readability-function-cognitive-complexity.IgnoreMacros
value: true
########################################################################
# Readability - Function Cognitive Complexity Ended
########################################################################
########################################################################
# Readability - Identifier Length Began
########################################################################
- key: readability-identifier-length.MinimumVariableNameLength
value: 1
- key: readability-identifier-length.MinimumParameterNameLength
value: 1
- key: readability-identifier-length.MinimumLoopCounterNameLength
value: 1
- key: readability-identifier-length.MinimumExceptionNameLength
value: 1
########################################################################
# Readability - Identifier Length Ended
########################################################################
########################################################################
# Readability - Identifier Naming Began
########################################################################
- key: readability-identifier-naming
value: CamelCase
- key: readability-identifier-naming.AbstractClassCase
value: CamelCase
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassConstantCase
value: CamelCase
- key: readability-identifier-naming.ClassMemberCase
value: CamelCase
- key: readability-identifier-naming.ClassMethodCase
value: camelBack
- key: readability-identifier-naming.ConstantCase
value: CamelCase
- key: readability-identifier-naming.ConstantMemberCase
value: CamelCase
- key: readability-identifier-naming.ConstantParameterCase
value: CamelCase
- key: readability-identifier-naming.ConstantPointerParameterCase
value: CamelCase
- key: readability-identifier-naming.ConstexprFunctionCase
value: camelBack
- key: readability-identifier-naming.ConstexprMethodCase
value: camelBack
- key: readability-identifier-naming.ConstexprVariableCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumIgnoredRegexp
value: "[A-Za-z0-9]+_t"
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.FunctionIgnoredRegexp
# This affects friend function despite there is public/protected/private
# method case & ignored regexp.
value: "simple_display|hash_value|.+_begin|.+_end|find_as"
- key: readability-identifier-naming.GlobalConstantCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantPointerCase
value: CamelCase
- key: readability-identifier-naming.GlobalFunctionCase
value: camelBack
- key: readability-identifier-naming.GlobalFunctionIgnoredRegexp
# Multi-line regex literal: double quote is required, `\` to break.
value: "\
proto_implemented\
|report_prototype_implementation\
|report_assertion\
|simple_display\
|hash_value\
|make_tracer"
- key: readability-identifier-naming.GlobalPointerCase
value: CamelCase
- key: readability-identifier-naming.GlobalVariableCase
value: CamelCase
- key: readability-identifier-naming.InlineNamespaceCase
value: lower_case
- key: readability-identifier-naming.LocalConstantCase
value: CamelCase
- key: readability-identifier-naming.LocalConstantPointerCase
value: CamelCase
- key: readability-identifier-naming.LocalPointerCase
value: CamelCase
- key: readability-identifier-naming.LocalVariableCase
value: CamelCase
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.MacroDefinitionPrefix
value: W2N_
- key: readability-identifier-naming.MacroDefinitionIgnoredRegexp
# Multi-line regex literal: double quote is required, `\` to break.
value: "\
((_)?w2n_[a-zA-Z0-9][a-zA-Z0-9_]+)\
|DECL\
|STMT\
|EXPR\
|TYPE\
|FIRST_(DECL|STMT|EXPR|TYPE)\
|LAST_(DECL|STMT|EXPR|TYPE)\
|(DECL|STMT|EXPR|TYPE)_RANGE\
|BUILTIN|BUILTIN_.+\
|ERROR|WARNING|NOTE|REMARK|FIXIT|DIAG|EDUCATIONAL_NOTES\
|HAS_TRIVIAL_DISPLAY\
|([A-Z]+_STATISTIC)"
# readability-identifier-naming.MemberCase no longer works because we
# defined public/private member's case separately
# readability-identifier-naming.MethodCase no longer works because we
# defined public/private method's case separately
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.NamespaceIgnoredRegexp
value: 'Lowering|MachO'
- key: readability-identifier-naming.ParameterCase
value: CamelCase
- key: readability-identifier-naming.ParameterIgnoredRegexp
# os: simple_display(llvm::raw_ostream& os, const T& ss), output stream
# ss: simple_display(llvm::raw_ostream& os, const T& ss), streamed subject
# hs: llvm::hash_code hash_value(const T& hs), hashed subject
value: '(os|ss|hs)'
- key: readability-identifier-naming.ParameterPackCase
value: CamelCase
- key: readability-identifier-naming.PointerParameterCase
value: CamelCase
- key: readability-identifier-naming.PointerParameterIgnoredRegexp
# ss: simple_display(llvm::raw_ostream& os, const T * ss), streamed subject
# hs: llvm::hash_code hash_value(const T * hs), hashed subject
value: '(ss|hs)'
- key: readability-identifier-naming.PrivateMemberCase
value: CamelCase
- key: readability-identifier-naming.PrivateMethodCase
value: camelBack
- key: readability-identifier-naming.privateMethodIgnoredRegexp
value: "simple_display|hash_value|.+_begin|.+_end|find_as"
- key: readability-identifier-naming.ProtectedMemberCase
value: CamelCase
- key: readability-identifier-naming.ProtectedMethodCase
value: camelBack
- key: readability-identifier-naming.ProtectedMethodIgnoredRegexp
value: "simple_display|hash_value|.+_begin|.+_end|find_as"
- key: readability-identifier-naming.PublicMemberCase
value: CamelCase
- key: readability-identifier-naming.PublicMethodCase
value: camelBack
- key: readability-identifier-naming.PublicMethodIgnoredRegexp
value: "simple_display|hash_value|.+_begin|.+_end|find_as"
- key: readability-identifier-naming.ScopedEnumConstantCase
value: CamelCase
- key: readability-identifier-naming.ScopedEnumConstantIgnoredRegexp
value: '(First|Last)_[A-Za-z0-9]+'
- key: readability-identifier-naming.StaticConstantCase
value: CamelCase
- key: readability-identifier-naming.StaticVariableCase
value: CamelCase
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TemplateTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TypeAliasCase
value: CamelCase
- key: readability-identifier-naming.TypeAliasIgnoredRegexp
# Multi-line regex literal: double quote is required, `\` to break.
value: "\
.+_iterator\
|[A-Za-z0-9]+_t"
- key: readability-identifier-naming.TypedefCase
value: CamelCase
- key: readability-identifier-naming.TypeTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.ValueTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: CamelCase
- key: readability-identifier-naming.VirtualMethodCase
value: camelBack
########################################################################
# Readability - Identifier Naming Ended
########################################################################
- key: readability-implicit-bool-conversion
value: true
- key: readability-inconsistent-declaration-parameter-name
value: true
- key: readability-inconsistent-declaration-parameter-name
value: true
- key: readability-isolate-declaration
value: true
- key: readability-magic-numbers
value: true
- key: readability-magic-numbers
value: true
- key: readability-make-member-function-const
value: true
- key: readability-misleading-indentation
value: true
- key: readability-misplaced-array-index
value: true
- key: readability-named-parameter
value: true
- key: readability-named-parameter
value: true
- key: readability-non-const-parameter
value: true
- key: readability-qualified-auto
value: true
- key: readability-redundant-access-specifiers
value: false
- key: readability-redundant-control-flow
value: true
- key: readability-redundant-declaration
value: true
- key: readability-redundant-function-ptr-dereference
value: true
- key: readability-redundant-member-init
value: true
- key: readability-redundant-preprocessor
value: true
- key: readability-redundant-smartptr-get
value: true
- key: readability-redundant-string-cstr
value: true
- key: readability-redundant-string-init
value: true
- key: readability-redundant-string-init.StringNames
value: ::std::basic_string;::std::basic_string_view,::llvm::StringRef
- key: readability-simplify-boolean-expr
value: true
- key: readability-simplify-boolean-expr.SimplifyDeMorgan
value: false
- key: readability-simplify-subscript-expr
value: true
- key: readability-simplify-subscript-expr.Types
value: '
::std::basic_string;
::std::basic_string_view;
::std::vector;
::std::array;
::llvm::ArrayRef;
::llvm::MutableArrayRef;
'
- key: readability-static-accessed-through-instance
value: true
- key: readability-static-definition-in-anonymous-namespace
value: true
- key: readability-string-compare
value: true
- key: readability-suspicious-call-argument
value: false
- key: readability-uniqueptr-delete-release
value: true
- key: readability-uppercase-literal-suffix
value: true
- key: readability-use-anyofallof
value: true