forked from MythTV/mythtv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-tidy
276 lines (210 loc) · 10.9 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
# 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-*,
# As of 2023-05-22, there are 156 unique warnings. ,
-bugprone-assignment-in-if-condition
# As of 2022-12-19, there are 1014 unique warnings. ,
-bugprone-easily-swappable-parameters,
# As of 2023-09-19, there are 7 unique warnings. ,
-bugprone-empty-catch,
# As of 2023-05-22, there are 97 unique warnings. ,
-bugprone-implicit-widening-of-multiplication-result,
# Renamed/replaced by cppcoreguidelines-narrowing-conversions. ,
-bugprone-narrowing-conversions,
# As of 2023-09-19, there are 140 unique warnings. ,
-bugprone-switch-missing-default-case,
cert-*,
# 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-*,
# 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,
# Explicitly list the tests that arent aliases. ,
-cppcoreguidelines-*,
# Good. ,
cppcoreguidelines-init-variables,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-pro-type-static-cast-downcast,
# As of 2022-12-19, there are 142 unique warnings. ,
-cppcoreguidelines-avoid-goto,
# As of 2023-05-22, there are 1257 unique warnings. ,
-cppcoreguidelines-avoid-non-const-global-variables,
# As of 2023-05-22, there are 374 unique warnings. ,
-cppcoreguidelines-narrowing-conversions,
# As of 2022-12-19, there are 212 unique warnings. ,
-cppcoreguidelines-no-malloc,
# No gsl. ,
-cppcoreguidelines-owning-memory,
# No gsl. Warning on every log message.
# "do not implicitly decay an array into a pointer; consider
# using gsl::array_view or an explicit cast instead" ,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
# No gsl. Recommends gsl::at be used in 1611 places. ,
-cppcoreguidelines-pro-bounds-constant-array-index,
# As of 2022-12-19, there are 4624 unique warnings. ,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
# As of 2022-12-19, there are 17 unique warnings. ,
-cppcoreguidelines-pro-type-const-cast,
# As of 2023-05-22, there are 744 unique warnings. ,
-cppcoreguidelines-pro-type-cstyle-cast,
# As of 2022-12-19, there are 425 unique warnings. ,
-cppcoreguidelines-pro-type-reinterpret-cast,
# Recommends using boost:: to access unions. ,
-cppcoreguidelines-pro-type-union-access,
# Warns on every (*)printf, sscanf,open, ioctl, etc. ,
-cppcoreguidelines-pro-type-vararg,
# As of 2022-12-19, there are 140 unique warnings. ,
-cppcoreguidelines-slicing,
# As of 2022-12-19, there are 1283 unique warnings. ,
-cppcoreguidelines-special-member-functions,
-google-explicit-constructor,
-google-runtime-int,
misc-*,
# New in clang15. As of 2023-05-22, there are 15546 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 2022-12-19, 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,
modernize-*,
# Noisy!!! foo(void) => foo() ,
-modernize-redundant-void-arg,
# As of 2023-09-29, there are 14 unique warnings
remaining. These all come from calls to
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,
# The Q_DECLARE_METATYPE macro triggers a warning from this
# new clang12 checker. As of 2022-12-19, the vast majority
# of these (236 of 292) warnings are associated with this
# macro; the other 56 are in the MythTV code. ,
-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. ,
-readability-function-cognitive-complexity,
# Not investigated yet. ,
-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: 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' }