forked from bmwcarit/ramses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-tidy
269 lines (251 loc) · 9.63 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# -------------------------------------------------------------------------
# Copyright (C) 2018 BMW Car IT GmbH
# -------------------------------------------------------------------------
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# -------------------------------------------------------------------------
---
Checks:
# disable all by default and enable selected checks
'-*,
bugprone-argument-comment,
bugprone-assert-side-effect,
bugprone-bool-pointer-implicit-conversion,
# TODO bugprone-branch-clone,
bugprone-copy-constructor-init,
bugprone-dangling-handle,
bugprone-exception-escape,
bugprone-fold-init-type,
bugprone-forward-declaration-namespace,
bugprone-forwarding-reference-overload,
bugprone-inaccurate-erase,
bugprone-incorrect-roundings,
bugprone-integer-division,
bugprone-lambda-function-name,
bugprone-macro-repeated-side-effects,
bugprone-misplaced-operator-in-strlen-in-alloc,
bugprone-misplaced-widening-cast,
bugprone-move-forwarding-reference,
bugprone-multiple-statement-macro,
bugprone-parent-virtual-call,
bugprone-posix-return,
bugprone-sizeof-container,
bugprone-sizeof-expression,
bugprone-string-constructor,
bugprone-string-integer-assignment,
bugprone-string-literal-with-embedded-nul,
bugprone-suspicious-enum-usage,
bugprone-suspicious-memset-usage,
bugprone-suspicious-missing-comma,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-swapped-arguments,
bugprone-terminating-continue,
bugprone-throw-keyword-missing,
bugprone-too-small-loop-variable,
bugprone-undefined-memory-manipulation,
bugprone-undelegated-constructor,
# TODO(tobias) false positives: bugprone-unhandled-self-assignment,
bugprone-unused-raii,
bugprone-unused-return-value,
bugprone-use-after-move,
bugprone-virtual-near-miss,
bugprone-spuriously-wake-up-functions,
bugprone-suspicious-include,
bugprone-misplaced-pointer-arithmetic-in-alloc,
bugprone-reserved-identifier,
cert-dcl16-c,
cert-dcl21-cpp,
cert-dcl54-cpp,
cert-dcl58-cpp,
cert-dcl59-cpp,
cert-env33-c,
cert-err09-cpp,
cert-err52-cpp,
cert-err60-cpp,
cert-err61-cpp,
cert-fio38-c,
cert-msc32-c,
cert-msc51-cpp,
cert-oop11-cpp,
cert-dcl50-cpp,
cert-flp30-c,
# TODO(tobias) false positives: cert-oop54-cpp,
cert-oop57-cpp,
clang-analyzer-apiModeling.StdCLibraryFunctions,
clang-analyzer-apiModeling.TrustNonnull,
clang-analyzer-apiModeling.google.GTest,
clang-analyzer-apiModeling.llvm.CastValue,
clang-analyzer-apiModeling.llvm.ReturnValue,
clang-analyzer-core.CallAndMessage,
clang-analyzer-core.DivideZero,
clang-analyzer-core.DynamicTypePropagation,
clang-analyzer-core.NonNullParamChecker,
clang-analyzer-core.NonnilStringConstants,
clang-analyzer-core.NullDereference,
clang-analyzer-core.StackAddrEscapeBase,
clang-analyzer-core.StackAddressEscape,
clang-analyzer-core.UndefinedBinaryOperatorResult,
clang-analyzer-core.VLASize,
clang-analyzer-core.builtin.BuiltinFunctions,
clang-analyzer-core.builtin.NoReturnFunctions,
clang-analyzer-core.uninitialized.ArraySubscript,
clang-analyzer-core.uninitialized.Assign,
clang-analyzer-core.uninitialized.Branch,
clang-analyzer-core.uninitialized.CapturedBlockVariable,
clang-analyzer-core.uninitialized.UndefReturn,
clang-analyzer-deadcode.DeadStores,
clang-analyzer-nullability.NullPassedToNonnull,
clang-analyzer-nullability.NullReturnedFromNonnull,
clang-analyzer-nullability.NullabilityBase,
clang-analyzer-nullability.NullableDereferenced,
clang-analyzer-nullability.NullablePassedToNonnull,
clang-analyzer-nullability.NullableReturnedFromNonnull,
clang-analyzer-optin.cplusplus.UninitializedObject,
clang-analyzer-optin.mpi.MPI-Checker,
clang-analyzer-optin.performance.GCDAntipattern,
clang-analyzer-optin.performance.Padding,
clang-analyzer-optin.portability.UnixAPI,
clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
clang-analyzer-security.insecureAPI.SecuritySyntaxChecker,
clang-analyzer-security.insecureAPI.UncheckedReturn,
clang-analyzer-security.insecureAPI.bcmp,
clang-analyzer-security.insecureAPI.bcopy,
clang-analyzer-security.insecureAPI.bzero,
clang-analyzer-security.insecureAPI.getpw,
clang-analyzer-security.insecureAPI.gets,
clang-analyzer-security.insecureAPI.mkstemp,
clang-analyzer-security.insecureAPI.mktemp,
clang-analyzer-security.insecureAPI.rand,
clang-analyzer-security.insecureAPI.strcpy,
clang-analyzer-security.insecureAPI.vfork,
clang-analyzer-unix.API,
clang-analyzer-unix.DynamicMemoryModeling,
clang-analyzer-unix.Malloc,
clang-analyzer-unix.MallocSizeof,
clang-analyzer-unix.MismatchedDeallocator,
clang-analyzer-unix.Vfork,
clang-analyzer-unix.cstring.BadSizeArg,
clang-analyzer-unix.cstring.CStringModeling,
clang-analyzer-unix.cstring.NullArg,
clang-analyzer-valist.CopyToSelf,
clang-analyzer-valist.Uninitialized,
clang-analyzer-valist.Unterminated,
clang-analyzer-valist.ValistBase,
clang-analyzer-cplusplus.InnerPointer,
clang-analyzer-cplusplus.Move,
clang-analyzer-cplusplus.NewDelete,
clang-analyzer-cplusplus.NewDeleteLeaks,
clang-analyzer-cplusplus.SelfAssignment,
clang-analyzer-cplusplus.SmartPtr,
# TODO clang-analyzer-optin.cplusplus.VirtualCall,
clang-analyzer-security.FloatLoopCounter,
google-explicit-constructor,
google-global-names-in-headers,
google-readability-casting,
# TODO google-readability-todo,
google-runtime-operator,
google-build-explicit-make-pair,
# alias: hicpp-avoid-goto,
# TODO hicpp-multiway-paths-covered,
# TODO hicpp-named-parameter,
hicpp-no-assembler,
hicpp-noexcept-move,
hicpp-signed-bitwise,
hicpp-exception-baseclass,
misc-redundant-expression,
misc-unused-alias-decls,
misc-unused-parameters,
misc-unused-using-decls,
misc-definitions-in-headers,
# TODO misc-misplaced-const,
misc-redundant-expression,
misc-unused-alias-decls,
misc-unused-parameters,
misc-unused-using-decls,
misc-unconventional-assign-operator,
modernize-avoid-c-arrays,
modernize-use-nullptr,
modernize-use-bool-literals,
modernize-raw-string-literal,
modernize-use-nodiscard,
modernize-use-using,
modernize-deprecated-headers,
modernize-make-unique,
modernize-make-shared,
modernize-use-override,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-constructor-init,
performance-noexcept-move-constructor,
performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
performance-no-automatic-move,
portability-simd-intrinsics,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
readability-redundant-preprocessor,
readability-redundant-smartptr-get,
readability-redundant-string-cstr
readability-braces-around-statements,
# TODO readability-container-size-empty,
# TODO readability-convert-member-functions-to-static,
readability-deleted-default,
readability-isolate-declaration,
readability-delete-null-pointer,
readability-inconsistent-declaration-parameter-name,
readability-non-const-parameter,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-redundant-string-init,
readability-simplify-subscript-expr,
# TODO readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release,
readability-misleading-indentation,
readability-misplaced-array-index,
readability-implicit-bool-conversion,
cppcoreguidelines-avoid-goto,
cppcoreguidelines-c-copy-assignment-signature,
cppcoreguidelines-interfaces-global-init,
# TODO cppcoreguidelines-narrowing-conversions,
cppcoreguidelines-no-malloc,
# TODO cppcoreguidelines-pro-type-cstyle-cast,
cppcoreguidelines-slicing,
cppcoreguidelines-avoid-non-const-global-variable,
cppcoreguidelines-pro-type-reinterpret-cast,
'
# everything that is enabled is also an error
WarningsAsErrors: '*'
# no headers filtered here, done later in wrapper script
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: cert-oop57-cpp.MemSetNames
value: ramses_internal::PlatformMemory::Set
- key: cert-oop57-cpp.MemCpyNames
value: ramses_internal::PlatformMemory::Copy
- key: cert-oop57-cpp.MemCmpNames
value: ramses_internal::PlatformMemory::Compare
- key: readability-implicit-bool-conversion.AllowIntegerConditions
value: true
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: true
- key: modernize-use-override.AllowOverrideAndFinal
value: true
- key: hicpp-signed-bitwise.IgnorePositiveIntegerLiterals
value: true