-
Notifications
You must be signed in to change notification settings - Fork 361
Expand file tree
/
Copy path.clang-tidy
More file actions
334 lines (261 loc) · 14 KB
/
Copy path.clang-tidy
File metadata and controls
334 lines (261 loc) · 14 KB
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
330
331
332
333
334
# 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.
#
# The idle_inhibit_unstable files are generated by the wayland-scanner
# program and should also be ignored.
#
# Ignore any Qt created moc files. These slip in occasionally.
#
# Ignore some libmythmpeg2 headers. These need to be specified by
# file name instead of directory name, because the latter doesn't work
# properly in various different build cases.
#,
ExcludeHeaderFilterRegex: 'external|include|idle_inhibit_unstable|moc_[[:alnum:]_-]+\.cpp|\.moc$|mpeg2[[:alnum:]_-]*\.h$'
UseColor: true
Checks: '-*,
bugprone-*,
# Using function invokes a command interpreter. Should fix.
# As of 2022-12-19, there are 9 warnings. ,
-bugprone-command-processor,
# 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 2026-07-12 there are 65 unique warnings. Many of these
# are from the MythRect and MFileInfo classes, which redefine
# multiple (non-virtual) function from their base classes. The
# ScheduleEditor class is also a big problem, as it inherits
# from multiple xxxMixin classes ( misc-multiple-inheritance)
# that all have the same set of function names. ,
-bugprone-derived-method-shadowing-base-method,
# As of 2023-09-19, there are 140 unique warnings. ,
-bugprone-switch-missing-default-case,
# Lots of complaints about constructors of static objects
# possibly throwing exceptions that cant be caught. As of
# 2023-05-22, there are 508 warnings. ,
-bugprone-throwing-static-initialization,
# string-to-number conversion functions that do not verify the
# validity of the conversion. As of 2023-05-22, there are 43
# warnings. ,
-bugprone-unchecked-string-to-number-conversion,
-cert-*,
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,
# Disable these warnings until they can be analyzed. ,
-clang-analyzer-optin.cplusplus.VirtualCall,
# Disable new WebKit warnings. They should only apply to code
# specifically related to WebKit (which MythTV only accesses
# via QtWebEngine), but they are currently applied
# everywhere. ,
-clang-analyzer-webkit.*,
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 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 4624 unique warnings. ,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
# New in clang-22 as of 2026-05-31. ,
-cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,
# As of 2024-08-02, there are 22 unique warnings. ,
-cppcoreguidelines-pro-type-const-cast,
# This check flags all use of C-style casts that perform a
# static_cast downcast, const_cast, or reinterpret_cast. This
# would be a subset of modernize-avoid-c-style-cast. As of
# 2026-05-31-22, there are 564 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 2025-06-28, there are 959 unique warnings. ,
-cppcoreguidelines-use-enum-class,
# 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,
# New in clang-22. As of 2026-06-02, there are 64 warnings.
# The vast majority are related to storing settings in the
# database. ,
-misc-multiple-inheritance,
# 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-*,
# Finds usages of C-style casts. As of 2026-05-31-22, there
# are 2635 warnings. ,
-modernize-avoid-c-style-cast,
# Dont declare c-style varardic functions. As of 2026-04-15,
# there is 1 warning in lirc_client.cpp. ,
-modernize-avoid-variadic-functions,
# 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,
# New in clang-22. As of 2026-05-31, the newest version of
# clang-tidy has a ton of these warnings. ,
-modernize-use-designated-initializers,
# A number of these could be cleaned up now, but many of these
# are from comparing the result of the Qt count functions to a
# [uint]. These count functions return an [int] in Qt5 which
# triggers this warning, but in Qt6 they will return a [uint]
# and the code wont trigger the warning. Wait until Qt6 is
# required and revisit then. ,
-modernize-use-integer-sign-comparison,
# Why would anyone want this? ,
-modernize-use-trailing-return-type,
# Disable newer C++14/17 tests for now. ,
-modernize-use-nodiscard,
# Disable tests recommending c++23 std::print command. ,
-modernize-use-std-print,
performance-*,
# All performance checks. ,
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,
# Wants to rewrite every use of 127/255 as a reference to
# std::numeric_limits. ,
-readability-use-numeric-limits,
# Added new C++23 directives with no way to disable them. ,
-readability-use-concise-preprocessor-directives,
'
CheckOptions:
- { key: bugprone-narrowing-conversions.PedanticMode, value: 0 }
- { key: bugprone-suspicious-include.IgnoredRegex, value: '^(.*/)?(moc_.+)(\.cpp)$' }
- { key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison, value: 1 }
- { key: bugprone-pointer-arithmetic-on-polymorphic-object.IgnoreInheritedVirtualFunctions, value: 1 }
- { key: bugprone-unused-return-value.AllowCastToVoid, value: 1 }
- { key: bugprone-unsafe-functions.ReportMoreUnsafeFunctions, value: 1 }
- { key: cppcoreguidelines-avoid-do-while.IgnoreMacros, value: 1 }
- { key: cppcoreguidelines-avoid-non-const-global-variables.AllowInternalLinkage, value: 1 }
- { key: cppcoreguidelines-pro-type-member-init.IgnoreArrays, value: 1 }
- { key: misc-header-include-cycle.IgnoredFilesList, value: 'qglobal.h;mem.h;common.h' }
- { key: misc-throw-by-value-catch-by-reference.WarnOnLargeObject, value: 1 }
- { 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-enum-size.EnumIgnoreList, value: 'some_compilers' }
- { key: performance-inefficient-vector-operation.VectorLikeClasses,
value: '::std::vector,QList,QByteArrayList,QItemSelection,QQueue,QStringList' }
- { key: readability-braces-around-statements.ShortStatementLines, value: 4 }
- { key: readability-function-cognitive-complexity.IgnoreMacros, value: 1 }
- { 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' }