forked from MythTV/mythtv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-tidy
225 lines (174 loc) · 8.7 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
# 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-*,
-bugprone-misplaced-widening-cast,
# Renamed/replaced by cppcoreguidelines-narrowing-conversions. ,
-bugprone-narrowing-conversions,
# Doesn''t distinguish between identifiers in the code and
# those supplied on the command line with "-X_FOO=BAR". The
# only remaining positives are those passed on the command
# line. New in clang11. ,
-bugprone-reserved-identifier,
cert-*,
# Aliases for bugprone-reserved-identifier,
-cert-dcl37-c,
-cert-dcl51-cpp,
# Dont declare c-style varardic functions. ,
-cert-dcl50-cpp,
# Using function invokes a command interpreter. Should fix. ,
-cert-env33-c,
# string-to-number conversion functions that do not verify the
# validity of the conversion. Needs work. ,
-cert-err34-c,
# Lots of complaints about constructors of static objects
# possibly throwing exceptions that cant be caught. These
# all appear to be within Qt code that cant be fixed by us. ,
-cert-err58-cpp,
# Similar to bugprone-signed-char-misuse but not quite the same. ,
-cert-str34-c,
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,
# Needs work. ,
-cppcoreguidelines-avoid-goto,
# About 20,000 of warnings. ,
-cppcoreguidelines-avoid-non-const-global-variables,
# Tons of warnings. Most complaining that #define should
# become a constexpr. ,
-cppcoreguidelines-macro-usage,
# Bunch of warnings.... ,
-cppcoreguidelines-narrowing-conversions,
-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,
# Bunch of warnings.... ,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-const-cast,
# Bunch of warnings.... ,
-cppcoreguidelines-pro-type-cstyle-cast,
# Haven''t checked recently. ,
-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,
-cppcoreguidelines-slicing,
-cppcoreguidelines-special-member-functions,
-google-explicit-constructor,
-google-runtime-int,
misc-*,
# Cases exist. Need to add getters/setters to classes. ,
-misc-non-private-member-variables-in-classes,
# The Q_DECLARE_METATYPE_IMPL macro triggers a warning from
# this checker. There are also a handful of places where
# MythTV uses recursion on purpose. These should be checked to
# ensure there are no problems. ,
-misc-no-recursion,
modernize-*,
# Noisy!!! foo(void) => foo() ,
-modernize-redundant-void-arg,
# Why would anyone want this? ,
-modernize-use-trailing-return-type,
# Disable newer C++14/17 tests for now. ,
-modernize-use-nodiscard,
performance-*,
readability-*,
# Need to decide on an appropriate value. ,
-readability-function-cognitive-complexity,
# Not investigated yet. ,
-readability-function-size,
# Wants to rewrite lots of implicit nullptr tests. ,
-readability-implicit-bool-conversion,
# Lots of noise. Needs work. ,
-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: 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-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' }