Bug 1879449 [wpt PR 44489] - [wptrunner] Add `infrastructure/expected-fail/` test...
[gecko.git] / tools / clang-tidy / config.yaml
blob773e92914faf50508a4c232dd5ce80e51a328951
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.
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: "17.0.6"
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-switch-missing-default-case
67     reliability: high
68   - name: bugprone-too-small-loop-variable
69     reliability: high
70   - name: bugprone-unused-raii
71     reliability: high
72   - name: bugprone-use-after-move
73     reliability: high
74   - name: clang-analyzer-core.CallAndMessage
75     reliability: medium
76   - name: clang-analyzer-core.DivideZero
77     reliability: high
78   - name: clang-analyzer-core.NonNullParamChecker
79     reliability: high
80   - name: clang-analyzer-core.NullDereference
81     reliability: medium
82   - name: clang-analyzer-core.UndefinedBinaryOperatorResult
83     reliability: medium
84   - name: clang-analyzer-core.uninitialized.Assign
85     reliability: medium
86   - name: clang-analyzer-core.uninitialized.Branch
87     reliability: medium
88   - name: clang-analyzer-cplusplus.Move
89     reliability: high
90   - name: clang-analyzer-cplusplus.NewDelete
91     reliability: medium
92   - name: clang-analyzer-cplusplus.NewDeleteLeaks
93     reliability: medium
94   - name: clang-analyzer-deadcode.DeadStores
95     reliability: high
96   - name: clang-analyzer-optin.performance.Padding
97     reliability: high
98     config:
99       - key: AllowedPad
100         value: 2
101   - name: clang-analyzer-security.FloatLoopCounter
102     reliability: high
103   - name: clang-analyzer-security.insecureAPI.bcmp
104     reliability: high
105   - name: clang-analyzer-security.insecureAPI.bcopy
106     reliability: high
107   - name: clang-analyzer-security.insecureAPI.bzero
108     reliability: high
109   - name: clang-analyzer-security.insecureAPI.getpw
110     reliability: high
111   # We don't add clang-analyzer-security.insecureAPI.gets here; it's deprecated.
112   - name: clang-analyzer-security.insecureAPI.mkstemp
113     reliability: high
114   - name: clang-analyzer-security.insecureAPI.mktemp
115     reliability: high
116   - name: clang-analyzer-security.insecureAPI.rand
117     reliability: low
118     # C checker, that is outdated and doesn't check for the new std::rand calls.
119     publish: !!bool no
120   - name: clang-analyzer-security.insecureAPI.strcpy
121     reliability: low
122     # The functions that should be used differ on POSIX and Windows, and there
123     # isn't a consensus on how we should approach this.
124     publish: !!bool no
125   - name: clang-analyzer-security.insecureAPI.UncheckedReturn
126     reliability: low
127   - name: clang-analyzer-security.insecureAPI.vfork
128     reliability: medium
129   - name: clang-analyzer-unix.Malloc
130     reliability: high
131   - name: clang-analyzer-unix.cstring.BadSizeArg
132     reliability: high
133   - name: clang-analyzer-unix.cstring.NullArg
134     reliability: high
135   - name: cppcoreguidelines-narrowing-conversions
136     reliability: high
137   - name: cppcoreguidelines-pro-type-member-init
138     reliability: medium
139   - name: misc-include-cleaner
140     # Disable this checker until we move to before/after
141     reliability: high
142     publish: !!bool no
143   - name: misc-non-copyable-objects
144     reliability: high
145   - name: misc-redundant-expression
146     reliability: medium
147   - name: misc-unused-alias-decls
148     reliability: high
149   - name: misc-unused-using-decls
150     reliability: high
151   - name: modernize-avoid-bind
152     restricted-platforms:
153       - win32
154       - win64
155     reliability: medium
156   - name: modernize-concat-nested-namespaces
157     reliability: high
158   - name: modernize-deprecated-ios-base-aliases
159     reliability: high
160   - name: modernize-loop-convert
161     reliability: high
162   - name: modernize-raw-string-literal
163     reliability: high
164   - name: modernize-redundant-void-arg
165     reliability: high
166     # We still have some old C code that is built with a C compiler, so this
167     # might break the build.
168     publish: !!bool no
169   - name: modernize-shrink-to-fit
170     reliability: high
171   - name: modernize-use-auto
172     reliability: high
173     # Controversial, see bug 1371052.
174     publish: !!bool no
175   - name: modernize-use-bool-literals
176     reliability: high
177   - name: modernize-use-equals-default
178     reliability: high
179   - name: modernize-use-equals-delete
180     reliability: high
181   - name: modernize-use-nullptr
182     reliability: high
183   - name: modernize-use-override
184     reliability: low
185     # Too noisy because of the way how we implement NS_IMETHOD. See Bug 1420366.
186     publish: !!bool no
187   - name: modernize-use-using
188     reliability: high
189   - name: mozilla-*
190     reliability: high
191   - name: performance-avoid-endl
192     reliability: high
193     # enable from clang 18
194     #  - name: performance-enum-size
195     #    reliability: high
196   - name: performance-faster-string-find
197     reliability: high
198   - name: performance-for-range-copy
199     reliability: high
200   - name: performance-implicit-conversion-in-loop
201     reliability: high
202   - name: performance-inefficient-algorithm
203     restricted-platforms:
204       - linux64
205       - macosx64
206     reliability: high
207     # Disable as the test does not support C++17 yet
208     publish: !!bool no
209   - name: performance-inefficient-string-concatenation
210     reliability: high
211   - name: performance-inefficient-vector-operation
212     reliability: high
213   - name: performance-move-const-arg
214     reliability: high
215     config:
216       - key: CheckTriviallyCopyableMove
217         # As per Bug 1558359 - disable detection of trivially copyable types
218         # that do not have a move constructor.
219         value: 0
220   - name: performance-move-constructor-init
221     reliability: high
222   - name: performance-noexcept-move-constructor
223     reliability: high
224   - name: performance-type-promotion-in-math-fn
225     reliability: high
226   - name: performance-unnecessary-copy-initialization
227     reliability: high
228   - name: performance-unnecessary-value-param
229     reliability: high
230     config:
231       - key: AllowedTypes
232         # Allow EnumSet because it only has a non-trivial copy constructor
233         # in debug builds.
234         value: ::mozilla::EnumSet
235   - name: readability-braces-around-statements
236     reliability: high
237     config:
238       - key: ShortStatementLines
239         # Allow `if (foo) return;` without braces
240         # Still warns on `if (foo)\n return;`
241         value: 1
242   - name: readability-const-return-type
243     reliability: high
244   # Note: this can be loosened up by using the ShortStatementLines option
245   - name: readability-container-size-empty
246     reliability: high
247   - name: readability-delete-null-pointer
248     reliability: high
249   - name: readability-else-after-return
250     reliability: high
251     config:
252       - key: WarnOnConditionVariables
253         # Disable as we don't mind this kind of behavior
254         value: 0
255   - name: readability-implicit-bool-conversion
256     reliability: low
257     # On automation the config flags act strange. Please see Bug 1500241.
258     publish: !!bool no
259     config:
260       - key: AllowIntegerConditions
261         # The check will allow conditional integer conversions.
262         value: 1
263       - key: AllowPointerConditions
264         # The check will allow conditional pointer conversions.
265         value: 1
266   - name: readability-inconsistent-declaration-parameter-name
267     reliability: high
268   - name: readability-isolate-declaration
269     # As per bug 1558987 - we don't want to have this enabled
270     publish: !!bool no
271     reliability: high
272   - name: readability-magic-numbers
273     # Bug 1553495 - we must see first its impact on our code.
274     publish: !!bool no
275     reliability: high
276   - name: readability-misleading-indentation
277     reliability: high
278   - name: readability-non-const-parameter
279     reliability: high
280   - name: readability-qualified-auto
281     reliability: high
282   - name: readability-redundant-control-flow
283     reliability: high
284   - name: readability-redundant-member-init
285     reliability: high
286   - name: readability-redundant-preprocessor
287     reliability: high
288   - name: readability-redundant-smartptr-get
289     reliability: high
290   - name: readability-redundant-string-cstr
291     reliability: high
292   - name: readability-redundant-string-init
293     reliability: high
294   - name: readability-static-accessed-through-instance
295     reliability: high
296   - name: readability-simplify-boolean-expr
297     reliability: high
298     config:
299       - key: SimplifyDeMorgan
300         # Don't want to enable DeMorgan expressions because of MOZ_ASSERT()
301         # See Bug 1804160
302         value: 0
303   - name: readability-uniqueptr-delete-release
304     reliability: high
305   # We don't publish the google checkers since we are interested in only having
306   # a general idea how our code complies with the rules added by these checkers.
307   - name: google-build-explicit-make-pair
308     reliability: low
309     publish: !!bool no
310   - name: google-build-namespaces
311     reliability: low
312     publish: !!bool no
313   - name: google-build-using-namespace
314     reliability: low
315     publish: !!bool no
316   - name: google-default-arguments
317     reliability: low
318     publish: !!bool no
319   - name: google-explicit-constructor
320     reliability: low
321     publish: !!bool no
322   - name: google-global-names-in-headers
323     reliability: low
324     publish: !!bool no
325   - name: google-readability-casting
326     reliability: low
327     publish: !!bool no
328   - name: google-readability-function-size
329     reliability: low
330     publish: !!bool no
331   - name: google-readability-namespace-comments
332     reliability: low
333     publish: !!bool no
334   - name: google-readability-todo
335     reliability: low
336     publish: !!bool no
337   - name: google-runtime-int
338     reliability: low
339     publish: !!bool no
340   - name: google-runtime-operator
341     reliability: low
342     publish: !!bool no
343   - name: google-runtime-references
344     reliability: low
345     publish: !!bool no