forked from MythTV/mythtv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-tidy
329 lines (258 loc) · 12.6 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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# Crappy parser. Only uses a comma to delineate the end of a line, so
# all comments must end with a comma. A single quote inside a comment
# also screws up the parsing.
#
# The goal is to pass all of the following:
#
# bugprone-*
# cert-*
# clang-analyzer-*
# cppcoreguidelines-*
# misc-*
# modernize-*
# performance-*
# readability-*
#
# Some specific checks may never be enabled, like
# clang-analyzer-security.insecureAPI.strcpy which requires a missing
# library to fix problems. Others like modernize-redundant-void-arg
# seem unnecessary. Some others may never be enabled by default, like
# clang-analyzer-core.CallAndMessage which doesn't understand
# dynamic_cast and gives lots of false positives.
#,
# Skip warnings that are in files in an "external" directory. Also
# ignore warnings from a file in an "include" directory to ignore
# files that are "installed" from mythtv for mythplugins. These will
# be caught when processing files in the mythtv directory.
#
# Possible matches in order:
#
# file.h or ./file.h or dir/file.h or ./dir/file.h
# ../dir/file.h
# ../../libmyth<blah>/dir/format.h
#,
#HeaderFilterRegex: '^((\./)?([[:alnum:]]+/)?[[:alnum:]]+\.h|\.\./[[:alnum:]]+/[[:alnum:]]+\.h|\.\./\.\./libmyth[[:alnum:]]+/[[:alnum:]]+\.h|\.\./\.\./external/libmythsoundtouch/[[:alnum:]]+\.h)$'
#,
HeaderFilterRegex: '^((\./)?([[:alnum:]]+/)?[[:alnum:]]+\.h|\.\./[[:alnum:]]+/[[:alnum:]]+\.h|\.\./\.\./libmyth[[:alnum:]]+/[[:alnum:]]+\.h)$'
Checks: '-*,
bugprone-*,
# Skip tests that are redirects to other tests. ,
-bugprone-narrowing-conversions,
# As of 2022-12-19, there are 1014 unique warnings. ,
-bugprone-easily-swappable-parameters,
# As of 2023-09-19, there are 7 unique warnings. 1 is in
# libmythfreesurround and the others are in libmythmheg. ,
-bugprone-empty-catch,
# As of 2023-05-22, there are 97 unique warnings. ,
-bugprone-implicit-widening-of-multiplication-result,
# As of 2023-09-19, there are 140 unique warnings. ,
-bugprone-switch-missing-default-case,
cert-*,
# Skip tests that are redirects to other tests. ,
-cert-con36-c,
-cert-con54-cpp,
-cert-ctr56-cpp,
-cert-dcl03-c,
-cert-dcl16-c,
-cert-dcl37-c,
-cert-dcl51-cpp,
-cert-dcl54-cpp,
-cert-dcl59-cpp,
-cert-err09-cpp,
-cert-err61-cpp,
-cert-exp42-c,
-cert-fio38-c,
-cert-flp37-c,
-cert-int09-c,
-cert-msc24-c,
-cert-msc30-c
-cert-msc32-c,
-cert-msc33-c,
-cert-msc54-cpp,
-cert-oop11-cpp,
-cert-oop54-cpp,
-cert-pos44-c,
-cert-pos47-c,
-cert-sig30-c,
-cert-str34-c,
# Dont declare c-style varardic functions. As of 2022-12-19,
# there are 2 warnings: lirc_client.cpp and vbi.cpp. ,
-cert-dcl50-cpp,
# Using function invokes a command interpreter. Should fix.
# As of 2022-12-19, there are 9 warnings. ,
-cert-env33-c,
# Calls to standard library functions where the return value
# isnt checked. These should all be fixed. As of 2023-05-22,
# there are 340 warnings. ,
-cert-err33-c,
# string-to-number conversion functions that do not verify the
# validity of the conversion. As of 2023-05-22, there are 43
# warnings. ,
-cert-err34-c,
# Lots of complaints about constructors of static objects
# possibly throwing exceptions that cant be caught. As of
# 2023-05-22, there are 508 warnings. ,
-cert-err58-cpp,
clang-analyzer-*,
# This complains about all instances where an enum is used to
# define a set of bit flags, and then one or more of those
# flags are or-ed together. ,
-clang-analyzer-optin.core.EnumCastOutOfRange,
# The "safe" versions functions were optional in the standard
# and were never implemented by GCC or Clang. There has been
# a move to have these functions removed from the standard as
# "the design suffers from far too many problems to
# correct". There are warnings in 5 or 6 files. ,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-clang-analyzer-security.insecureAPI.strcpy,
cppcoreguidelines-*,
# Skip tests that are redirects to other tests. ,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-explicit-virtual-functions,
-cppcoreguidelines-macro-to-enum,
-cppcoreguidelines-noexcept-destructor,
-cppcoreguidelines-noexcept-move-operations,
-cppcoreguidelines-noexcept-swap,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-use-default-member-init,
# Skip tests that recommend usage of the Microsoft Guidelines
# Support Library. https://github.com/microsoft/GSL ,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
# Skip tests that recommend usage of the boost:: framework to
# access unions. https://www.boost.org/ ,
-cppcoreguidelines-pro-type-union-access,
# As of 2024-08-01, there are 110 unique warnings. ,
-cppcoreguidelines-avoid-const-or-ref-data-members,
# As of 2024-08-01, there are 12256 unique warnings. ,
-cppcoreguidelines-avoid-do-while,
# As of 2024-08-03, there are 135 unique warnings. ,
-cppcoreguidelines-avoid-goto,
# As of 2023-05-22, there are 1257 unique warnings. ,
-cppcoreguidelines-avoid-non-const-global-variables,
# As of 2024-08-01, there are 2 warnings. ,
-cppcoreguidelines-macro-usage,
# As of 2023-05-22, there are 374 unique warnings. ,
-cppcoreguidelines-narrowing-conversions,
# As of 2024-08-02, there are 210 unique warnings. ,
-cppcoreguidelines-no-malloc,
# As of 2024-08-02, there are 4624 unique warnings. ,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
# As of 2024-08-02, there are 22 unique warnings. ,
-cppcoreguidelines-pro-type-const-cast,
# As of 2023-05-22, there are 744 unique warnings. ,
-cppcoreguidelines-pro-type-cstyle-cast,
# As of 2024-08-02, there are 498 unique warnings. ,
-cppcoreguidelines-pro-type-reinterpret-cast,
# Warns on every (*)printf, sscanf,open, ioctl, etc. ,
-cppcoreguidelines-pro-type-vararg,
# As of 2024-08-02, there are 140 unique warnings. ,
-cppcoreguidelines-slicing,
# As of 2024-08-02, there are 1547 unique warnings. ,
-cppcoreguidelines-special-member-functions,
# As of 2024-08-01, there are 207 unique warnings. ,
-cppcoreguidelines-virtual-class-destructor,
-google-explicit-constructor,
-google-runtime-int,
misc-*,
# As of 2024-08-02, there are 15970 unique warnings. ,
-misc-const-correctness,
# As of 2023-09-19, there are 115517 unique warnings. ,
-misc-include-cleaner,
# Complains about every public or protected variable in a class. ,
-misc-non-private-member-variables-in-classes,
# As of 2028-08-02, there are 420 unique warnings. 195 are
# related to the Q_DECLARE_METATYPE macro and the other 225
# are in MythTV. ,
-misc-no-recursion,
# New in clang16. As of 2023-05-03, there are 1445 unique
# warnings. ,
-misc-use-anonymous-namespace,
# Temporarily disable this. ,
-misc-use-internal-linkage,
modernize-*,
# Noisy!!! foo(void) => foo() ,
-modernize-redundant-void-arg,
# As of 2024-08-08, all remaining warnings remaining come from
# calls to QFETCH Q_GLOBAL_STATIC_WITH_ARGS and cant be fixed
# by us. ,
-modernize-type-traits,
# Why would anyone want this? ,
-modernize-use-trailing-return-type,
# Disable newer C++14/17 tests for now. ,
-modernize-use-nodiscard,
# Renamed from cppcoreguidelines-macro-to-enum in clang15. As
# of 2023-05-22, there are 41 unique warnings. ,
-modernize-macro-to-enum,
performance-*,
# As of 2023-09-19, there are 443 unique warnings. ,
-performance-avoid-endl,
# As of 2024-08-01, new filtering reduces this count to 14
# unique warnings. ,
-performance-enum-size,
# As of 2024-08-01, new filtering reduces this count to 35
# unique warnings. ,
-performance-no-int-to-ptr,
readability-*,
# As of 2023-09-19, there are 315 unique warnings. ,
-readability-avoid-unconditional-preprocessor-if,
# Need to decide on an appropriate value. As of 2024-08-02
# there are 1753 unique warnings at the default complexity
# value. ,
-readability-function-cognitive-complexity,
# Need to decide on an appropriate value. As of 2024-08-02
# there are only 2 unique warnings at the default size limit
# of 800 statements. ,
-readability-function-size,
# Whats wrong with single character variable names? As of
# 2022-12-19, there are 9889 unique warnings. ,
-readability-identifier-length,
# Wants to rewrite lots of implicit nullptr tests. As of
# 2022-12-19, there are 426 unique warnings. ,
-readability-implicit-bool-conversion,
# As of 2023-05-22, there are 14798 unique warnings. ,
-readability-magic-numbers,
# Doesn''t understand Qt signals/slots. ,
-readability-redundant-access-specifiers,
'
CheckOptions:
- { key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: 1 }
- { key: bugprone-pointer-arithmetic-on-polymorphic-object.IgnoreInheritedVirtualFunctions, value: 1 }
- { key: cppcoreguidelines-pro-type-member-init.IgnoreArrays, value: 1 }
- { key: cppcoreguidelines-narrowing-conversions.PedanticMode, value: 0 } # test 1 at some point
- { key: misc-header-include-cycle.IgnoredFilesList, value: 'qglobal.h;mem.h;common.h' }
- { key: modernize-make-shared.IgnoreMacros, value: 0 }
- { key: modernize-make-unique.IgnoreMacros, value: 0 }
- { key: modernize-use-bool-literals.IgnoreMacros, value: 1 }
- { key: modernize-use-default-member-init.IgnoreMacros, value: 1 }
- { key: modernize-use-equals-default.IgnoreMacros, value: 0 }
- { key: modernize-use-nullptr.NullMacros, value: 'Z_NULL' }
- { key: modernize-use-using.IgnoreMacros, value: 1 }
- { key: performance-inefficient-vector-operation.VectorLikeClasses,
value: '::std::vector,QList,QByteArrayList,QItemSelection,QQueue,QStringList' }
- { key: readability-braces-around-statements.ShortStatementLines, value: 3 }
- { key: readability-implicit-bool-conversion.AllowPointerConditions, value: 1 }
- { key: readability-implicit-bool-conversion.AllowIntegerConditions, value: 1 }
- { key: readability-inconsistent-declaration-parameter-name.strict, value: 1 }
- { key: readability-redundant-member-init.IgnoreBaseInCopyConstructors, value: 1 }
- { key: readability-redundant-declaration.IgnoreMacros, value: 0 }
- { key: readability-simplify-boolean-expr.chainedconditionalreturn, value: 1 }
- { key: readability-simplify-boolean-expr.chainedconditionalassignment, value: 1 }
- { key: readability-uppercase-literal-suffix.IgnoreMacros, value: 0 }
- { key: readability-simplify-subscript-expr.Types,
value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array;QByteArray;QString' }
- { key: readability-identifier-naming.PrivateMethodCase, value: 'aNy_CasE' }
- { key: readability-identifier-naming.PrivateMemberCase, value: 'camelBack' }
- { key: readability-identifier-naming.PrivateMemberPrefix, value: 'm_'}
- { key: readability-identifier-naming.ProtectedMethodCase, value: 'aNy_CasE' }
- { key: readability-identifier-naming.ProtectedMemberCase, value: 'camelBack' }
- { key: readability-identifier-naming.ProtectedMemberPrefix, value: 'm_'}
- { key: readability-identifier-naming.PuplicMethodCase, value: 'aNy_CasE' }
- { key: readability-identifier-naming.PuplicMemberCase, value: 'camelBack' }
- { key: readability-identifier-naming.PuplicMemberPrefix, value: 'm_'}
- { key: readability-identifier-naming.ClassConstantCase, value: 'aNy_CasE' }
- { key: readability-identifier-naming.ClassConstantPrefix, value: 'k' }
- { key: google-runtime-int.TypeSuffix, value: '_t' }