Source code

Revision control

Other Tools

1
---
2
target: obj-x86_64-pc-linux-gnu
3
# It is used by 'mach static-analysis' and 'phabricator static-analysis bot'
4
# in order to have consistency across the used checkers.
5
# All the clang checks used by the static-analysis tools.
6
#
7
# To add a new checker:
8
# 1. Add it in this file
9
# 2. Create a C/C++ test case in tools/clang-tidy/test/ reproducing the
10
# warning/error that the checker will detect
11
# 3. Run './mach static-analysis autotest -d' to create the reference
12
# 4. Check the json file in tools/clang-tidy/test/
13
# 5. Commit this file + the .cpp test case + the json result
14
platforms:
15
- linux64
16
- macosx64
17
- win32
18
- win64
19
# Minimum clang-tidy version that is required for all the following checkers
20
# to work properly.
21
# This is also used by 'mach clang-format'
22
package_version: "9.0.1"
23
clang_checkers:
24
- name: -*
25
publish: !!bool no
26
- name: bugprone-argument-comment
27
reliability: high
28
- name: bugprone-assert-side-effect
29
reliability: high
30
- name: bugprone-bool-pointer-implicit-conversion
31
reliability: low
32
- name: bugprone-forward-declaration-namespace
33
reliability: high
34
- name: bugprone-incorrect-roundings
35
reliability: high
36
- name: bugprone-integer-division
37
reliability: high
38
- name: bugprone-macro-parentheses
39
reliability: medium
40
- name: bugprone-macro-repeated-side-effects
41
reliability: high
42
- name: bugprone-misplaced-widening-cast
43
reliability: high
44
- name: bugprone-move-forwarding-reference
45
reliability: high
46
- name: bugprone-multiple-statement-macro
47
# Incompatible with our code base, see bug 1496379.
48
publish: !!bool no
49
reliability: high
50
- name: bugprone-sizeof-expression
51
reliability: high
52
- name: bugprone-string-constructor
53
reliability: high
54
- name: bugprone-string-integer-assignment
55
reliability: high
56
- name: bugprone-suspicious-memset-usage
57
reliability: high
58
- name: bugprone-suspicious-missing-comma
59
reliability: high
60
- name: bugprone-suspicious-semicolon
61
reliability: high
62
- name: bugprone-suspicious-string-compare
63
reliability: high
64
- name: bugprone-swapped-arguments
65
reliability: high
66
- name: bugprone-too-small-loop-variable
67
reliability: high
68
- name: bugprone-unused-raii
69
reliability: high
70
- name: bugprone-use-after-move
71
reliability: high
72
- name: clang-analyzer-core.CallAndMessage
73
reliability: medium
74
- name: clang-analyzer-core.DivideZero
75
reliability: high
76
- name: clang-analyzer-core.NonNullParamChecker
77
reliability: high
78
- name: clang-analyzer-core.NullDereference
79
reliability: medium
80
- name: clang-analyzer-core.UndefinedBinaryOperatorResult
81
reliability: medium
82
- name: clang-analyzer-core.uninitialized.Assign
83
reliability: medium
84
- name: clang-analyzer-core.uninitialized.Branch
85
reliability: medium
86
- name: clang-analyzer-cplusplus.Move
87
reliability: high
88
- name: clang-analyzer-cplusplus.NewDelete
89
reliability: medium
90
- name: clang-analyzer-cplusplus.NewDeleteLeaks
91
reliability: medium
92
- name: clang-analyzer-deadcode.DeadStores
93
reliability: high
94
- name: clang-analyzer-security.FloatLoopCounter
95
reliability: high
96
- name: clang-analyzer-security.insecureAPI.bcmp
97
reliability: high
98
- name: clang-analyzer-security.insecureAPI.bcopy
99
reliability: high
100
- name: clang-analyzer-security.insecureAPI.bzero
101
reliability: high
102
- name: clang-analyzer-security.insecureAPI.getpw
103
reliability: high
104
# We don't add clang-analyzer-security.insecureAPI.gets here; it's deprecated.
105
- name: clang-analyzer-security.insecureAPI.mkstemp
106
reliability: high
107
- name: clang-analyzer-security.insecureAPI.mktemp
108
reliability: high
109
- name: clang-analyzer-security.insecureAPI.rand
110
reliability: low
111
# C checker, that is outdated and doesn't check for the new std::rand calls.
112
publish: !!bool no
113
- name: clang-analyzer-security.insecureAPI.strcpy
114
reliability: low
115
# The functions that should be used differ on POSIX and Windows, and there
116
# isn't a consensus on how we should approach this.
117
publish: !!bool no
118
- name: clang-analyzer-security.insecureAPI.UncheckedReturn
119
reliability: low
120
- name: clang-analyzer-security.insecureAPI.vfork
121
reliability: medium
122
- name: clang-analyzer-unix.Malloc
123
reliability: high
124
- name: clang-analyzer-unix.cstring.BadSizeArg
125
reliability: high
126
- name: clang-analyzer-unix.cstring.NullArg
127
reliability: high
128
- name: cppcoreguidelines-narrowing-conversions
129
reliability: high
130
- name: cppcoreguidelines-pro-type-member-init
131
reliability: medium
132
- name: misc-non-copyable-objects
133
reliability: high
134
- name: misc-redundant-expression
135
reliability: medium
136
- name: misc-unused-alias-decls
137
reliability: high
138
- name: misc-unused-using-decls
139
reliability: high
140
- name: modernize-avoid-bind
141
restricted-platforms:
142
- win32
143
- win64
144
reliability: medium
145
- name: modernize-concat-nested-namespaces
146
reliability: high
147
- name: modernize-deprecated-ios-base-aliases
148
reliability: high
149
- name: modernize-loop-convert
150
reliability: high
151
- name: modernize-raw-string-literal
152
reliability: high
153
- name: modernize-redundant-void-arg
154
reliability: high
155
# We still have some old C code that is built with a C compiler, so this
156
# might break the build.
157
publish: !!bool no
158
- name: modernize-shrink-to-fit
159
reliability: high
160
- name: modernize-use-auto
161
reliability: high
162
# Controversial, see bug 1371052.
163
publish: !!bool no
164
- name: modernize-use-bool-literals
165
reliability: high
166
- name: modernize-use-equals-default
167
reliability: high
168
- name: modernize-use-equals-delete
169
reliability: high
170
- name: modernize-use-nullptr
171
reliability: high
172
- name: modernize-use-override
173
reliability: low
174
# Too noisy because of the way how we implement NS_IMETHOD. See Bug 1420366.
175
publish: !!bool no
176
- name: modernize-use-using
177
reliability: high
178
- name: mozilla-*
179
reliability: high
180
- name: performance-faster-string-find
181
reliability: high
182
- name: performance-for-range-copy
183
reliability: high
184
- name: performance-implicit-conversion-in-loop
185
reliability: high
186
- name: performance-inefficient-algorithm
187
restricted-platforms:
188
- linux64
189
- macosx64
190
reliability: high
191
# Disable as the test does not support C++17 yet
192
publish: !!bool no
193
- name: performance-inefficient-string-concatenation
194
reliability: high
195
- name: performance-inefficient-vector-operation
196
reliability: high
197
- name: performance-move-const-arg
198
reliability: high
199
config:
200
- key: CheckTriviallyCopyableMove
201
# As per Bug 1558359 - disable detection of trivially copyable types
202
# that do not have a move constructor.
203
value: 0
204
- name: performance-move-constructor-init
205
reliability: high
206
- name: performance-noexcept-move-constructor
207
reliability: high
208
- name: performance-type-promotion-in-math-fn
209
reliability: high
210
- name: performance-unnecessary-copy-initialization
211
reliability: high
212
- name: performance-unnecessary-value-param
213
reliability: high
214
- name: readability-braces-around-statements
215
reliability: high
216
- name: readability-const-return-type
217
reliability: high
218
# Note: this can be loosened up by using the ShortStatementLines option
219
- name: readability-container-size-empty
220
reliability: high
221
- name: readability-delete-null-pointer
222
reliability: high
223
- name: readability-else-after-return
224
reliability: high
225
- name: readability-implicit-bool-conversion
226
reliability: low
227
# On automation the config flags act strange. Please see Bug 1500241.
228
publish: !!bool no
229
config:
230
- key: AllowIntegerConditions
231
# The check will allow conditional integer conversions.
232
value: 1
233
- key: AllowPointerConditions
234
# The check will allow conditional pointer conversions.
235
value: 1
236
- name: readability-inconsistent-declaration-parameter-name
237
reliability: high
238
- name: readability-isolate-declaration
239
# As per bug 1558987 - we don't want to have this enabled
240
publish: !!bool no
241
reliability: high
242
- name: readability-magic-numbers
243
# Bug 1553495 - we must see first its impact on our code.
244
publish: !!bool no
245
reliability: high
246
- name: readability-misleading-indentation
247
reliability: high
248
- name: readability-non-const-parameter
249
reliability: high
250
- name: readability-redundant-control-flow
251
reliability: high
252
- name: readability-redundant-preprocessor
253
reliability: high
254
- name: readability-redundant-smartptr-get
255
reliability: high
256
- name: readability-redundant-string-cstr
257
reliability: high
258
- name: readability-redundant-string-init
259
reliability: high
260
- name: readability-static-accessed-through-instance
261
reliability: high
262
- name: readability-simplify-boolean-expr
263
reliability: high
264
- name: readability-uniqueptr-delete-release
265
reliability: high
266
# We don't publish the google checkers since we are interested in only having
267
# a general idea how our code complies with the rules added by these checkers.
268
- name: google-build-explicit-make-pair
269
reliability: low
270
publish: !!bool no
271
- name: google-build-namespaces
272
reliability: low
273
publish: !!bool no
274
- name: google-build-using-namespace
275
reliability: low
276
publish: !!bool no
277
- name: google-default-arguments
278
reliability: low
279
publish: !!bool no
280
- name: google-explicit-constructor
281
reliability: low
282
publish: !!bool no
283
- name: google-global-names-in-headers
284
reliability: low
285
publish: !!bool no
286
- name: google-readability-casting
287
reliability: low
288
publish: !!bool no
289
- name: google-readability-function-size
290
reliability: low
291
publish: !!bool no
292
- name: google-readability-namespace-comments
293
reliability: low
294
publish: !!bool no
295
- name: google-readability-todo
296
reliability: low
297
publish: !!bool no
298
- name: google-runtime-int
299
reliability: low
300
publish: !!bool no
301
- name: google-runtime-operator
302
reliability: low
303
publish: !!bool no
304
- name: google-runtime-references
305
reliability: low
306
publish: !!bool no