xref: /openbmc/bmcweb/.clang-tidy (revision 36c0f2a3)
1Checks: '
2-*,
3boost-use-to-string,
4bugprone-argument-comment,
5bugprone-assert-side-effect,
6bugprone-assignment-in-if-condition,
7bugprone-bad-signal-to-kill-thread,
8bugprone-bool-pointer-implicit-conversion,
9bugprone-branch-clone,
10bugprone-casting-through-void,
11bugprone-chained-comparison,
12bugprone-compare-pointer-to-member-virtual-function,
13bugprone-copy-constructor-init,
14bugprone-dangling-handle,
15bugprone-dynamic-static-initializers,
16bugprone-empty-catch,
17bugprone-exception-escape,
18bugprone-fold-init-type,
19bugprone-forward-declaration-namespace,
20bugprone-forwarding-reference-overload,
21bugprone-implicit-widening-of-multiplication-result,
22bugprone-inaccurate-erase,
23bugprone-inc-dec-in-conditions,
24bugprone-incorrect-enable-if,
25bugprone-incorrect-roundings,
26bugprone-infinite-loop,
27bugprone-integer-division,
28bugprone-lambda-function-name,
29bugprone-macro-parentheses,
30bugprone-macro-repeated-side-effects,
31bugprone-misplaced-operator-in-strlen-in-alloc,
32bugprone-misplaced-pointer-arithmetic-in-alloc,
33bugprone-misplaced-widening-cast,
34bugprone-move-forwarding-reference,
35bugprone-multi-level-implicit-pointer-conversion,
36bugprone-multiple-new-in-one-expression,
37bugprone-multiple-statement-macro,
38bugprone-narrowing-conversions,
39bugprone-no-escape,
40bugprone-non-zero-enum-to-bool-conversion,
41bugprone-not-null-terminated-result,
42bugprone-optional-value-conversion,
43bugprone-parent-virtual-call,
44bugprone-posix-return,
45bugprone-redundant-branch-condition,
46bugprone-reserved-identifier,
47bugprone-shared-ptr-array-mismatch,
48bugprone-signal-handler,
49bugprone-signed-char-misuse,
50bugprone-sizeof-container,
51bugprone-sizeof-expression,
52bugprone-spuriously-wake-up-functions,
53bugprone-standalone-empty,
54bugprone-string-constructor,
55bugprone-string-integer-assignment,
56bugprone-string-literal-with-embedded-nul,
57bugprone-stringview-nullptr,
58bugprone-suspicious-enum-usage,
59bugprone-suspicious-include,
60bugprone-suspicious-memory-comparison,
61bugprone-suspicious-memset-usage,
62bugprone-suspicious-missing-comma,
63bugprone-suspicious-realloc-usage,
64bugprone-suspicious-semicolon,
65bugprone-suspicious-string-compare,
66bugprone-swapped-arguments,
67bugprone-switch-missing-default-case,
68bugprone-terminating-continue,
69bugprone-throw-keyword-missing,
70bugprone-too-small-loop-variable,
71bugprone-unchecked-optional-access,
72bugprone-undefined-memory-manipulation,
73bugprone-undelegated-constructor,
74bugprone-unhandled-exception-at-new,
75bugprone-unhandled-self-assignment,
76bugprone-unique-ptr-array-mismatch,
77bugprone-unsafe-functions,
78bugprone-unused-local-non-trivial-variable,
79bugprone-unused-raii,
80bugprone-unused-return-value,
81bugprone-use-after-move,
82bugprone-virtual-near-miss,
83cert-con36-c,
84cert-con54-cpp,
85cert-dcl03-c,
86cert-dcl16-c,
87cert-dcl21-cpp,
88cert-dcl37-c,
89cert-dcl50-cpp,
90cert-dcl51-cpp,
91cert-dcl54-cpp,
92cert-dcl58-cpp,
93cert-dcl59-cpp,
94cert-env33-c,
95cert-err09-cpp,
96cert-err34-c,
97cert-err52-cpp,
98cert-err60-cpp,
99cert-err61-cpp,
100cert-fio38-c,
101cert-flp30-c,
102cert-mem57-cpp,
103cert-msc30-c,
104cert-msc32-c,
105cert-msc50-cpp,
106cert-msc51-cpp,
107cert-oop11-cpp,
108cert-oop54-cpp,
109cert-oop57-cpp,
110cert-oop58-cpp,
111cert-pos44-c,
112cert-pos47-c,
113cert-sig30-c,
114cert-str34-c,
115clang-analyzer-apiModeling.Errno,
116clang-analyzer-apiModeling.TrustNonnull,
117clang-analyzer-apiModeling.TrustReturnsNonnull,
118clang-analyzer-apiModeling.google.GTest,
119clang-analyzer-apiModeling.llvm.CastValue,
120clang-analyzer-apiModeling.llvm.ReturnValue,
121clang-analyzer-core.BitwiseShift,
122clang-analyzer-core.CallAndMessage,
123clang-analyzer-core.CallAndMessageModeling,
124clang-analyzer-core.DivideZero,
125clang-analyzer-core.DynamicTypePropagation,
126clang-analyzer-core.NonNullParamChecker,
127clang-analyzer-core.NonnilStringConstants,
128clang-analyzer-core.NullDereference,
129clang-analyzer-core.StackAddrEscapeBase,
130clang-analyzer-core.StackAddressEscape,
131clang-analyzer-core.UndefinedBinaryOperatorResult,
132clang-analyzer-core.VLASize,
133clang-analyzer-core.builtin.BuiltinFunctions,
134clang-analyzer-core.builtin.NoReturnFunctions,
135clang-analyzer-core.uninitialized.ArraySubscript,
136clang-analyzer-core.uninitialized.Assign,
137clang-analyzer-core.uninitialized.Branch,
138clang-analyzer-core.uninitialized.CapturedBlockVariable,
139clang-analyzer-core.uninitialized.NewArraySize,
140clang-analyzer-core.uninitialized.UndefReturn,
141clang-analyzer-cplusplus.InnerPointer,
142clang-analyzer-cplusplus.Move,
143clang-analyzer-cplusplus.NewDelete,
144clang-analyzer-cplusplus.NewDeleteLeaks,
145clang-analyzer-cplusplus.PlacementNew,
146clang-analyzer-cplusplus.PureVirtualCall,
147clang-analyzer-cplusplus.SelfAssignment,
148clang-analyzer-cplusplus.SmartPtrModeling,
149clang-analyzer-cplusplus.StringChecker,
150clang-analyzer-cplusplus.VirtualCallModeling,
151clang-analyzer-deadcode.DeadStores,
152clang-analyzer-fuchsia.HandleChecker,
153clang-analyzer-nullability.NullPassedToNonnull,
154clang-analyzer-nullability.NullReturnedFromNonnull,
155clang-analyzer-nullability.NullabilityBase,
156clang-analyzer-nullability.NullableDereferenced,
157clang-analyzer-nullability.NullablePassedToNonnull,
158clang-analyzer-nullability.NullableReturnedFromNonnull,
159clang-analyzer-optin.core.EnumCastOutOfRange,
160clang-analyzer-optin.cplusplus.UninitializedObject,
161clang-analyzer-optin.cplusplus.VirtualCall,
162clang-analyzer-optin.mpi.MPI-Checker,
163clang-analyzer-optin.osx.OSObjectCStyleCast,
164clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker,
165clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker,
166clang-analyzer-optin.performance.GCDAntipattern,
167clang-analyzer-optin.performance.Padding,
168clang-analyzer-optin.portability.UnixAPI,
169clang-analyzer-osx.API,
170clang-analyzer-osx.MIG,
171clang-analyzer-osx.NSOrCFErrorDerefChecker,
172clang-analyzer-osx.NumberObjectConversion,
173clang-analyzer-osx.OSObjectRetainCount,
174clang-analyzer-osx.ObjCProperty,
175clang-analyzer-osx.SecKeychainAPI,
176clang-analyzer-osx.cocoa.AtSync,
177clang-analyzer-osx.cocoa.AutoreleaseWrite,
178clang-analyzer-osx.cocoa.ClassRelease,
179clang-analyzer-osx.cocoa.Dealloc,
180clang-analyzer-osx.cocoa.IncompatibleMethodTypes,
181clang-analyzer-osx.cocoa.Loops,
182clang-analyzer-osx.cocoa.MissingSuperCall,
183clang-analyzer-osx.cocoa.NSAutoreleasePool,
184clang-analyzer-osx.cocoa.NSError,
185clang-analyzer-osx.cocoa.NilArg,
186clang-analyzer-osx.cocoa.NonNilReturnValue,
187clang-analyzer-osx.cocoa.ObjCGenerics,
188clang-analyzer-osx.cocoa.RetainCount,
189clang-analyzer-osx.cocoa.RetainCountBase,
190clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak,
191clang-analyzer-osx.cocoa.SelfInit,
192clang-analyzer-osx.cocoa.SuperDealloc,
193clang-analyzer-osx.cocoa.UnusedIvars,
194clang-analyzer-osx.cocoa.VariadicMethodTypes,
195clang-analyzer-osx.coreFoundation.CFError,
196clang-analyzer-osx.coreFoundation.CFNumber,
197clang-analyzer-osx.coreFoundation.CFRetainRelease,
198clang-analyzer-osx.coreFoundation.containers.OutOfBounds,
199clang-analyzer-osx.coreFoundation.containers.PointerSizedValues,
200clang-analyzer-security.FloatLoopCounter,
201clang-analyzer-security.cert.env.InvalidPtr,
202clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
203clang-analyzer-security.insecureAPI.SecuritySyntaxChecker,
204clang-analyzer-security.insecureAPI.UncheckedReturn,
205clang-analyzer-security.insecureAPI.bcmp,
206clang-analyzer-security.insecureAPI.bcopy,
207clang-analyzer-security.insecureAPI.bzero,
208clang-analyzer-security.insecureAPI.decodeValueOfObjCType,
209clang-analyzer-security.insecureAPI.getpw,
210clang-analyzer-security.insecureAPI.gets,
211clang-analyzer-security.insecureAPI.mkstemp,
212clang-analyzer-security.insecureAPI.mktemp,
213clang-analyzer-security.insecureAPI.rand,
214clang-analyzer-security.insecureAPI.strcpy,
215clang-analyzer-security.insecureAPI.vfork,
216clang-analyzer-unix.API,
217clang-analyzer-unix.DynamicMemoryModeling,
218clang-analyzer-unix.Errno,
219clang-analyzer-unix.Malloc,
220clang-analyzer-unix.MallocSizeof,
221clang-analyzer-unix.MismatchedDeallocator,
222clang-analyzer-unix.StdCLibraryFunctions,
223clang-analyzer-unix.Vfork,
224clang-analyzer-unix.cstring.BadSizeArg,
225clang-analyzer-unix.cstring.CStringModeling,
226clang-analyzer-unix.cstring.NullArg,
227clang-analyzer-valist.CopyToSelf,
228clang-analyzer-valist.Uninitialized,
229clang-analyzer-valist.Unterminated,
230clang-analyzer-valist.ValistBase,
231clang-analyzer-webkit.NoUncountedMemberChecker,
232clang-analyzer-webkit.RefCntblBaseVirtualDtor,
233clang-analyzer-webkit.UncountedLambdaCapturesChecker,
234cppcoreguidelines-avoid-c-arrays,
235cppcoreguidelines-avoid-capturing-lambda-coroutines,
236cppcoreguidelines-avoid-goto,
237cppcoreguidelines-avoid-non-const-global-variables,
238cppcoreguidelines-avoid-reference-coroutine-parameters,
239cppcoreguidelines-c-copy-assignment-signature,
240cppcoreguidelines-explicit-virtual-functions,
241cppcoreguidelines-init-variables,
242cppcoreguidelines-interfaces-global-init,
243cppcoreguidelines-macro-to-enum,
244cppcoreguidelines-macro-usage,
245cppcoreguidelines-misleading-capture-default-by-value,
246cppcoreguidelines-narrowing-conversions,
247cppcoreguidelines-no-malloc,
248cppcoreguidelines-no-suspend-with-lock,
249cppcoreguidelines-noexcept-destructor,
250cppcoreguidelines-noexcept-move-operations,
251cppcoreguidelines-noexcept-swap,
252cppcoreguidelines-prefer-member-initializer,
253cppcoreguidelines-pro-bounds-array-to-pointer-decay,
254cppcoreguidelines-pro-bounds-pointer-arithmetic,
255cppcoreguidelines-pro-type-const-cast,
256cppcoreguidelines-pro-type-cstyle-cast,
257cppcoreguidelines-pro-type-member-init,
258cppcoreguidelines-pro-type-reinterpret-cast,
259cppcoreguidelines-pro-type-static-cast-downcast,
260cppcoreguidelines-pro-type-union-access,
261cppcoreguidelines-pro-type-vararg,
262cppcoreguidelines-rvalue-reference-param-not-moved,
263cppcoreguidelines-use-default-member-init,
264cppcoreguidelines-virtual-class-destructor,
265cppcoreguidelines-slicing,
266cppcoreguidelines-special-member-functions,
267google-explicit-constructor,
268misc-coroutine-hostile-raii,
269misc-header-include-cycle,
270misc-misleading-bidirectional,
271misc-misleading-identifier,
272misc-misplaced-const,
273misc-new-delete-overloads,
274misc-non-copyable-objects,
275misc-redundant-expression,
276misc-static-assert,
277misc-throw-by-value-catch-by-reference,
278misc-unconventional-assign-operator,
279misc-uniqueptr-reset-release,
280misc-unused-alias-decls,
281misc-unused-parameters,
282misc-unused-using-decls,
283modernize-avoid-bind,
284modernize-deprecated-headers,
285modernize-deprecated-ios-base-aliases,
286modernize-loop-convert,
287modernize-make-shared,
288modernize-make-unique,
289modernize-raw-string-literal,
290modernize-redundant-void-arg,
291modernize-replace-auto-ptr,
292modernize-replace-random-shuffle,
293modernize-return-braced-init-list,
294modernize-shrink-to-fit,
295modernize-unary-static-assert,
296modernize-use-bool-literals,
297modernize-use-default-member-init,
298modernize-use-emplace,
299modernize-use-equals-default,
300modernize-use-equals-delete,
301modernize-use-noexcept,
302modernize-use-nullptr,
303modernize-use-override,
304modernize-use-starts-ends-with,
305modernize-use-std-numbers,
306modernize-use-transparent-functors,
307modernize-use-uncaught-exceptions,
308modernize-use-using,
309performance-avoid-endl,
310performance-faster-string-find,
311performance-for-range-copy,
312performance-implicit-conversion-in-loop,
313performance-inefficient-algorithm,
314performance-inefficient-string-concatenation,
315performance-inefficient-vector-operation,
316performance-move-const-arg,
317performance-move-constructor-init,
318performance-no-automatic-move,
319performance-no-int-to-ptr,
320performance-noexcept-destructor,
321performance-noexcept-move-constructor,
322performance-noexcept-swap,
323performance-trivially-destructible,
324performance-type-promotion-in-math-fn,
325performance-unnecessary-copy-initialization,
326performance-unnecessary-value-param,
327readability-avoid-const-params-in-decls,
328readability-avoid-nested-conditional-operator,
329readability-avoid-return-with-void-value,
330readability-avoid-unconditional-preprocessor-if,
331readability-braces-around-statements,
332readability-const-return-type,
333readability-container-contains,
334readability-container-data-pointer,
335readability-container-size-empty,
336readability-convert-member-functions-to-static,
337readability-delete-null-pointer,
338readability-duplicate-include,
339readability-deleted-default,
340readability-else-after-return,
341readability-function-size,
342readability-identifier-naming,
343readability-implicit-bool-conversion,
344readability-inconsistent-declaration-parameter-name,
345readability-isolate-declaration,
346readability-make-member-function-const,
347readability-misleading-indentation,
348readability-misplaced-array-index,
349readability-named-parameter,
350readability-operators-representation,
351readability-non-const-parameter,
352readability-qualified-auto,
353readability-redundant-access-specifiers,
354readability-redundant-casting,
355readability-redundant-control-flow,
356readability-redundant-declaration,
357readability-redundant-function-ptr-dereference,
358readability-redundant-inline-specifier,
359readability-redundant-member-init,
360readability-redundant-preprocessor,
361readability-redundant-smartptr-get,
362readability-redundant-string-cstr,
363readability-redundant-string-init,
364readability-reference-to-constructed-temporary,
365readability-simplify-boolean-expr,
366readability-simplify-subscript-expr,
367readability-static-accessed-through-instance,
368readability-static-definition-in-anonymous-namespace,
369readability-string-compare,
370readability-suspicious-call-argument,
371readability-uniqueptr-delete-release,
372readability-uppercase-literal-suffix'
373
374WarningsAsErrors: '*'
375HeaderFilterRegex: '.*'
376CheckOptions:
377  - { key: readability-identifier-naming.ClassCase,     value: CamelCase  }
378  - { key: readability-identifier-naming.VariableCase,  value: camelBack }
379  - { key: readability-identifier-naming.FunctionCase,  value: camelBack }
380  - { key: readability-identifier-naming.ParameterCase, value: camelBack }
381  - { key: readability-identifier-naming.NamespaceCase, value: lower_case }
382  - { key: readability-identifier-naming.StructCase,    value: CamelCase  }
383  - { key: readability-identifier-naming.FunctionIgnoredRegexp,  value: (BMCWEB_LOG_DEBUG|BMCWEB_LOG_INFO|BMCWEB_LOG_WARNING|BMCWEB_LOG_ERROR|BMCWEB_LOG_CRITICAL) }
384  - { key: readability-identifier-naming.StructIgnoredRegexp,  value: (BMCWEB_LOG_DEBUG|BMCWEB_LOG_INFO|BMCWEB_LOG_WARNING|BMCWEB_LOG_ERROR|BMCWEB_LOG_CRITICAL) }
385  - { key: cppcoreguidelines-macro-usage.AllowedRegexp, value: DEBUG*|NLOHMANN_JSON_SERIALIZE_ENUM }
386  - { key: cppcoreguidelines-rvalue-reference-param-not-moved.IgnoreUnnamedParams, value: true }
387  - { key: misc-include-cleaner.IgnoreHeaders, value: ((nlohmann/json_fwd.hpp)|(boost/.*/src.hpp)|(boost/.*/detail/.*)|(nlohmann/detail/.*)|(stdio.h)|(ranges)|(bits/.*)|(boost/system/error_code.hpp)) }
388