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