-
Notifications
You must be signed in to change notification settings - Fork 29
/
.clang-tidy
671 lines (670 loc) · 51.6 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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
# abseil-cleanup-ctad Avoid doubled printing of type
# abseil-duration-addition Ensure explicit use of correct duration type
# abseil-duration-comparison Ensure explicit use of correct duration type
# abseil-duration-conversion-cast Ensure correct cast of durations
# abseil-duration-division Ensure explicit use of correct duration division
# abseil-duration-factory-float Avoid use of inperformant conversion funnctions
# abseil-duration-factory-scale Avoid use of wrong scale conversion funnctions
# abseil-duration-subtraction Ensure explicit use of correct duration type
# abseil-duration-unnecessary-conversion Avoid unnecessary conversion
# abseil-faster-strsplit-delimiter Avoid inperformant use of Strings when Characters are suggested
#xabseil-no-internal-dependencies Not used, cause use of internal details is probably intended when found
#xabseil-no-namespace Not used, cause use of namespace is probably intended when found
# abseil-redundant-strcat-calls Avoid unnecessary function calls
# abseil-str-cat-append Avoid concatination when appending is suggested
# abseil-string-find-startswith Ensure std::string::startsWith is called instead of find-functions
#xabseil-string-find-str-contains Not used, cause it suggests usage of abseil functions instead of standard library functions
# abseil-time-comparison Ensure explicit use of time type when comnparing times
# abseil-time-subtraction Ensure explicit use of time type
#xabseil-upgrade-duration-conversions Not used, as it suggests possibly unwanted casts, which te compiler already warns us about
#xaltera-id-dependent-backward-branch Not used, cause it did report at every loop # Avoid inperformant design of loops
# altera-kernel-name-restriction Avoid usage of files named similiar to internal API files
# altera-single-work-item-barrier Avoid unnecessary use of barriers
#xaltera-struct-pack-align Not used, cause we don't want allignment messages for structs nnot used in OpenCL kernels
#xaltera-unroll-loops Not used, cause it does not understand expression based unrolls and reports for all code, even code not in kernels
# boost-use-to-string Ensure use of standard library functions where possible
# bugprone-argument-comment Ensure correct use of argument names in comments
# bugprone-assert-side-effect Avoid assertions with side-effects
# bugprone-assignment-in-if-condition Avoid assignments in if-conditions
# bugprone-bad-signal-to-kill-thread Avoid SIGTERM when attempting to kill a thread
# bugprone-bool-pointer-implicit-conversion Avoid implicit conversion from pointer to bool
# bugprone-branch-clone Avoid identical branches
# bugprone-copy-constructor-init Avoid wrong usage of copy constructors
# bugprone-dangling-handle Avoid dangling references
# bugprone-dynamic-static-initializers Avoid dynamic initialization of static variables in possibly shared context
#xbugprone-easily-swappable-parameters Not used, cause it would require refactoring of API
#xbugprone-exception-escape Not used, cause it reported escape were non could take place # Avoid throwing of exceptions where it is not allowed
# bugprone-fold-init-type Ensure explicit use of correct type in fold functions
# bugprone-forward-declaration-namespace Avoid forward declarations in wrong namespace
# bugprone-forwarding-reference-overload Avoid use of perfect forwarding constructor where use of copy or move constructor is suggested
# bugprone-implicit-widening-of-multiplication-result Avoid unintended overflow on multiplication
# bugprone-inaccurate-erase Ensure correct use of erase functions
# bugprone-incorrect-roundings Avoid incorrect rounding of values
# bugprone-infinite-loop Avoid infinite loops
# bugprone-integer-division Avoid integer division in floating-point context
# bugprone-lambda-function-name Avoid printing the name of an unnamed function
# bugprone-macro-parentheses Avoid macros that rely on possibly misleading usage of parenthesis
#xbugprone-macro-repeated-side-effects Not used, cause I don't know what it does
# bugprone-misplaced-operator-in-strlen-in-alloc Avoid probably unintended addition to strings
# bugprone-misplaced-pointer-arithmetic-in-alloc Avoid probably unintended addition to pointers
# bugprone-misplaced-widening-cast Avoid loss of precision by misplaced casts
# bugprone-move-forwarding-reference Ensure forwarding references are forwared not moved
# bugprone-multiple-statement-macro Avoid statements from falling out an conditioned block when inserting macros. (NOTE: Should not happen if ifs without braces are avoided)
# bugprone-no-escape Ensure pointers marked as noescape do not escape from their scope
# bugprone-not-null-terminated-result Avoid strings, that are not null-terminated
# bugprone-parent-virtual-call Avoid calls of inherited virtual functions when a call to non-virtual function is suggested
# bugprone-posix-return Ensure posix fuinctions returning non-negatiove only do not return negative values
# bugprone-redundant-branch-condition Avoid nested if-statements with the same condition a parent has.
# bugprone-reserved-identifier Avoid usage of reserved names
# bugprone-shared-ptr-array-mismatch Avoid wrong initializationj of shared pointers with arrays
# bugprone-signal-handler Ensure correct behaviour of signal handlers
# bugprone-signed-char-misuse Ensure correct conversion from signed char to bigger signed integer types
# bugprone-sizeof-container Avoid use of sizeof where use of .size() is suggested
# bugprone-sizeof-expression Avoid use of sizeof where it is not suggested
# bugprone-spuriously-wake-up-functionsp Avoid missed spurious wakeup
# bugprone-standalone-empty Avoid use of .empty() where use of .clear() is suggested
# bugprone-string-constructor Avoid misuse of string constructors
# bugprone-string-integer-assignment Avoid assignments of integers to strings
# bugprone-string-literal-with-embedded-nul Avoid unintended use of escaped NUL characters in strings
# bugprone-stringview-nullptr Avoid string views of null-pointers
# bugprone-suspicious-enum-usage Avoid misuse of enums as integers where not suggested
# bugprone-suspicious-include Avoid inclusion of implementation files
# bugprone-suspicious-memory-comparison Avoid memory comparison where it seems to be not suggested
# bugprone-suspicious-memset-usage Avoid usage of memset in a way probably not suggested
# bugprone-suspicious-missing-comma Avoid possibly missing commata
# bugprone-suspicious-realloc-usage Ensure that memory does not get lost on failure of realloc
# bugprone-suspicious-semicolon Avoid semicolon where it is probably not intended
# bugprone-suspicious-string-compare Avoid wrong comparison of the result of a string comparison
# bugprone-swapped-arguments Avoid possibly swapped arguments on function calls
# bugprone-terminating-continue Avoid continue from being executed in every loop iteration, skipping parts of the loop body
# bugprone-throw-keyword-missing Ensure throw-keyword is used when exception might be thrown
# bugprone-too-small-loop-variable Ensure loop variables have a type big enough for the loops range
# bugprone-unchecked-optional-access Avoid unsafe access to optionals
# bugprone-undefined-memory-manipulation Avoid undefined manipulation of memory
# bugprone-undelegated-constructor Ensure delegated constructors are correctly called
# bugprone-unhandled-exception-at-new Ensure exception is handled on call of new, if not passed to parent function
#xbugprone-unhandled-self-assignment Not used, cause it reported even if the special case was handled # Avoid data loss on self assignment
# bugprone-unsafe-functions Ensure safe functions are used where available
# bugprone-unused-raii Avoid use of RAII where it is not suggested
# bugprone-unused-return-value Avoid unused return values
# bugprone-use-after-move Avoid usage of an object after it was moved
# bugprone-virtual-near-miss Avoid unintended misname of virtual functions in derived classes
# cert-dcl50-cpp Avoid c-style variadic functions
#xcert-dcl58-cpp Not used, cause use of namespace is probably intended when found
# cert-err34-c Avoid unchecked use of string to integer conversion functions
# cert-err52-cpp Avoid long jumps
# cert-err58-cpp Ensure exceptions in constructors at global space are handled
# cert-err60-cpp Ensure throw expressions are nothrow copy constructible
#xcert-flp30-c Not used, cause floats in for loops are probably intended when encountered
# cert-mem57-cpp Avoid use of default new operator for over-aligned types
#xcert-msc50-cpp Not used, cause usage of random number generators is probably intended when encountered
#xcert-msc51-cpp Not used, cause usage of random number generators is probably intended when encountered
# cert-oop57-cpp Avoid use of memory manipulation functions where a call to an apropriate class function is suggested
# cert-oop58-cpp Ensure source object is not modified on copy constructors
# concurrency-mt-unsafe Avoid parallel calls to non-threadsafe functions
# concurrency-thread-canceltype-asynchronous Ensure pthreads are cancled safely
# cppcoreguidelines-avoid-capture-default-when-capturing-this Avoid misleading captures in lambda functions
# cppcoreguidelines-avoid-capturing-lambda-coroutines Avoid use of already freed variables in asynchronous lambdas
# cppcoreguidelines-avoid-const-or-ref-data-members Ensure const accessors are used instead of const members
#xcppcoreguidelines-avoid-do-while Not used, cause do-while loops can also increase readability in some scenarios
# cppcoreguidelines-avoid-goto Avoid use of goto
# cppcoreguidelines-avoid-non-const-global-variables Avoid global variables, that are not const
# cppcoreguidelines-avoid-reference-coroutine-parameters Avoid dangling references by coroutines
#xcppcoreguidelines-init-variables Not used, cause it marked valid assignments and compiler already does such checks
# cppcoreguidelines-interfaces-global-init Avoid some order-of-initialization problems
# cppcoreguidelines-macro-usage Avoid usage of macros where modern language structures are suggested
# cppcoreguidelines-narrowing-conversions Avoid silent narrwoing
# cppcoreguidelines-no-malloc Avoid usage of c allocation where modern language structures are suggested
#xcppcoreguidelines-owning-memory Not used, cause we don't use gsl
#xcppcoreguidelines-prefer-member-initializer Not used, cause initialization should happen at constructor.
# cppcoreguidelines-pro-bounds-array-to-pointer-decay Avoid usage of pointers as arrays
#xcppcoreguidelines-pro-bounds-constant-array-index Not used, cause it did not detect in fact constant ranges (like for loops with constant upper bound) # Avoid out-of-bounds for static arrays
# cppcoreguidelines-pro-bounds-pointer-arithmetic Avoid usage of pointer-arithmetic
# cppcoreguidelines-pro-type-const-cast Avoid modification of const values
# cppcoreguidelines-pro-type-cstyle-cast Avoid unsafe casts
# cppcoreguidelines-pro-type-member-init Ensure class members are initialized
# cppcoreguidelines-pro-type-reinterpret-cast Avoid unsafe casts
# cppcoreguidelines-pro-type-static-cast-downcast Avoid use of static_cast where dynamic_cast is suggested
# cppcoreguidelines-pro-type-union-access Avoid use of unions (NOTE: Some compilers may explicitly allow the use of unions as type prunning)
# cppcoreguidelines-pro-type-vararg Avoid c-style variadic functions
# cppcoreguidelines-rvalue-reference-param-not-moved Ensure rvalue parameters are moved into a function
# cppcoreguidelines-slicing Avoid copying a derived instance into a base instance
# cppcoreguidelines-special-member-functions Ensure that all special members/constructors are defined
# cppcoreguidelines-virtual-class-destructor Ensure correct definition of virtual destructors
# darwin-avoid-spinlock Avoid use of deprecated locks
# darwin-dispatch-once-nonstatic Avoid undefined behaviour when dispatching
#xfuchsia-default-arguments-calls Not used, cause default arguments are intended to be used
#xfuchsia-default-arguments-declarations Not used, cause default arguments are intended to be used
#xfuchsia-multiple-inheritance Not used, cause multi inheritance is probably intended when encountered
#xfuchsia-overloaded-operator Not used, cause operator overloading is intended to be used
#xfuchsia-statically-constructed-objects Not used, cause already handled by other checks in a less restricting way
#xfuchsia-trailing-return Not used, cause I'm not sure what it does
#xfuchsia-virtual-inheritance Not used, cause virtual inheritance is probably intended when encountered
# google-build-explicit-make-pair Ensure correct types are used in make_pair
# google-build-namespaces Avoid anonymous namespaces in headers
# google-build-using-namespace Ensure explicit use of namespaces
#xgoogle-default-arguments Not used, cause default arguments are intended to be used
# google-explicit-constructor Avoid unintended implicit conversion
# google-global-names-in-headers Avoid excessive use of namespaces in headers
#xgoogle-readability-avoid-underscore-in-googletest-name Not used, cause naming of tests is up to the user
# google-readability-casting Avoid use of c-style casts
#xgoogle-readability-todo Not used, cause TODOs might often be used without assignment to bug numbers or users
#xgoogle-runtime-int Not used, cause platform-specific integer size may be intended
#xgoogle-runtime-operator Not used, cause operator overloading is intended to be used
# google-upgrade-googletest-case Avoid use of deprecated functions
# hicpp-exception-baseclass Ensure only exceptions are thrown
# hicpp-multiway-paths-covered Ensure explicit covering of all branches
# hicpp-no-assembler Avoid inline assembly
#xhicpp-signed-bitwise Not used, cause it is fixed or will be fixed in c++20 # Avoid undefined behaviour at bitwise operations on signed integers
#xllvm-header-guard Not used, cause it does not take care of root directory, generating very weird header guards
#xllvm-include-order Not used, cause different include order style might be wanted by user (see .clang-format)
# llvm-namespace-comment Ensure namespace end comment for long namespaces
#xlvm-prefer-isa-or-dyn-cast-in-conditionals Not used, cause use of different casts might be intended
#xllvm-prefer-register-over-unsigned Not used, cause I don't know where this applies
#xllvm-twine-local Not used, cause I don't know where this applies
#xllvmlibc-callee-namespace Not used, cause I don't know where this applies
#xllvmlibc-implementation-in-namespace Not used, cause I don't know where this applies
#xllvmlibc-inline-function-decl Not used, cause user might not use LLVM for compilation
#xllvmlibc-restrict-system-libc-headers Not used, cause user might not use LLVM for compilation
# misc-confusable-identifiers Avoid confusable identifiers
#xmisc-const-correctness Not used, cause id produced false-positives # Ensure const is used where suggested
# misc-definitions-in-headers Avoid not inlined definitions in headers
# misc-misleading-bidirectional Avoid misleading characters in code
# misc-misleading-identifier Avoid misleading characters in code
# misc-misplaced-const Avoid wrong usage of const caused by typedefs
# misc-new-delete-overloads Ensure each object-level new got an corresponding delete and the other way round
# misc-no-recursion Avoid recursion
# misc-non-copyable-objects Avoid copying types that are not copieable
#xmisc-non-private-member-variables-in-classes Not used, cause this would blow up code massively
# misc-redundant-expression Avoid redundant expressions
# misc-static-assert Avoid use of assert where static_assert is suggested
# misc-throw-by-value-catch-by-reference Ensure exceptions are catched by reference and thrown by value
# misc-unconventional-assign-operator Ensure assignment operators are correctly defined
# misc-uniqueptr-reset-release Ensure unique_ptr are moved on assignment
# misc-unused-alias-decls Avoid unused namespaces aliases
# misc-unused-parameters Avoid unused parameters
# misc-unused-using-decls Avoid unused usings
# misc-use-anonymous-namespace Ensure anonymouse namespaces are preferred before static global scope
# modernize-avoid-bind Avoid binding of functions where lambdas can be used
# modernize-avoid-c-arrays Avoid use of c-style arrays where std::array can be used
#xmodernize-concat-nested-namespaces Not used, as namespaces might be extended, later requiring rewriting
# modernize-deprecated-headers Avoid deprecated headers
# modernize-deprecated-ios-base-aliases Avoid deprecated namespace
#xmodernize-loop-convert Not used, cause range-based for might be bugprone and not usable in some situations
# modernize-macro-to-enum Avoid use of macros, where enums are suggested
#xmodernize-make-shared Not used, cause both does have pros and cons
#xmodernize-make-unique Not used, cause both does have pros and cons
# modernize-pass-by-value Avoid inefficient pass-by-reference
#xmodernize-raw-string-literal Not used, cause raw strings are confusing when mixed with non-raw strings
# modernize-redundant-void-arg Avoid use of void arg
# modernize-replace-auto-ptr Avoid use of deprecated type
# modernize-replace-disallow-copy-and-assign-macro Avoid deprecated macro
# modernize-replace-random-shuffle Avoid use of deprecated function
#xmodernize-return-braced-init-list Not used, cause array initializers hide explicite function calls, making it less clear what happens
# modernize-shrink-to-fit Ensure shrink_to_fit is used where suggested
# modernize-type-traits Ensure type_traits short functions are used
# modernize-unary-static-assert Avoid use of empty string static_assert
#xmodernize-use-auto Not used, cause auto hides type information
# modernize-use-bool-literals Avoid assigning integers to bools
#xmodernize-use-default-member-init Not used, cause initialization should happen at constructor.
# modernize-use-emplace Ensure emplace functions are used where suggested
# modernize-use-equals-default Ensure default constructor is explicitly defined where suggested
# modernize-use-equals-delete Ensure constructor is explicitly deleted where suggested
# modernize-use-nodiscard Ensure nodiscard is used where suggested
# modernize-use-noexcept Ensure noexcept is used where suggested
# modernize-use-nullptr Avoid use of NULL, instead use nullptr
# modernize-use-override Ensure override is used where suggested
#xmodernize-use-trailing-return-type Not used, cause it blows up code
#xmodernize-use-transparent-functors Not used, as the removed type information is probably relevant
# modernize-use-uncaught-exceptions Avoid usage of deprecated type
#xmodernize-use-using Not used, cause typedef has clear syntax and clear use, while using has not
# mpi-buffer-deref Avoid passing double pointers to mpi functions where single pointers are suggested
# mpi-type-mismatch Ensure correct type buffer is passed to mpi function
# openmp-exception-escape Ensure OpenMP blocks are well-bracketed
# openmp-use-default-none Ensure explicit declaration of data sharing type
# performance-faster-string-find Avoid call to find with a string literall where a call with a character is suggested
# performance-for-range-copy Avoid copying values in ranged for loops where use by reference is suggested
# performance-implicit-conversion-in-loop Avoid implicit conversion in ranged for loops
# performance-inefficient-algorithm Avoid inefficient usage of container functiosn where more efficient implementations exist
# performance-inefficient-string-concatenation Avoid addition of strings where appending is suggested
# performance-inefficient-vector-operation Avoid inefficient calls to std::vector functions where it could be acceletarted
# performance-move-const-arg Avoid move where none is suggested
# performance-move-constructor-init Avoid move construictor where copy constructor is suggested in initialization of base classes
# performance-no-automatic-move Avoid const where it prevents moving
# performance-no-int-to-ptr Avoid casts between integer and pointer
# performance-noexcept-move-constructor Ensure move constructors are marked with noexcept
# performance-trivially-destructible Avoid making a function non-trivial destructible when it should be possible
# performance-type-promotion-in-math-fn Ensure math float functions are explicitly called
# performance-unnecessary-copy-initialization Avoid copy initialization where initialization by const reference is suggested
# performance-unnecessary-value-param Avoid pass-by-value where pass-by-reference is suggested
# portability-simd-intrinsics Avoid use of SIMD builtins where standard library (experimental) function is suggested
# portability-std-allocator-const Avoid use of containers of const types
#xreadability-avoid-const-params-in-decls Not used, cause it may be intended to match declaration and definition
# readability-avoid-unconditional-preprocessor-if Avoid preprocessor ifs always evaluation to zrue/false
# readability-braces-around-statements Avoid conditionals and loops without braces, as they are bad readable, bugprone and bat maintainable
# readability-const-return-type Avoid const in return types, improving compiler optimizations
# readability-container-contains Avoid usage of find() and count() where use of contains() is suggested
# readability-container-data-pointer Ensure data() is used where available
# readability-container-size-empty Avoid usage of size() where use of empty() is suggested
# readability-convert-member-functions-to-static Ensure members are declared static when they actually are static
# readability-delete-null-pointer Avoid checks for nullptr where it is unnecessary
# readability-duplicate-include Avoid duplicate includes
#xreadability-else-after-return Not used, cause explicit usage of branches might highlight branch covering
#xreadability-function-cognitive-complexity Not used, cause no easy fis is suggested
#xreadability-function-size Not used, cause no easy fis is suggested
#xreadability-identifier-length Not used, cause no easy fis is suggested
# readability-identifier-naming Ensure consistent naming of identifiers
# readability-implicit-bool-conversion Avoid implicit conversion of bool
# readability-inconsistent-declaration-parameter-name Ensure names of parameters in definition match name of parametersin declaration
# readability-isolate-declaration Avoid declaring several variables in one statement
# readability-magic-numbers Avoid magic numbers
#xreadability-make-member-function-const Not used, cause is produces wrong results (mark functions const that have non-const access to members) # Ensure constant member functions are declared const
# readability-misleading-indentatione Ensure intendation is consistent
# readability-misplaced-array-index Avoid misused array index
# readability-named-parameter Ensure parameters are named
#xreadability-non-const-parameter Not used, cause is produces wrong results (mark parameters const that are have non-const accessed) # Ensure the use constant pointers where suggested
# readability-operators-representation Avoid mixed tokens for operators
# readability-qualified-auto Ensure auto pointers are declared as pointers
# readability-redundant-access-specifiers Avoid dooubling of access specifiers
# readability-redundant-control-flow Avoid unnecessary return or continue
# readability-redundant-declaration Avoid redundant declarations
# readability-redundant-function-ptr-dereference Avoid doubled dereferencing of functions where single dereference is suggested
# readability-redundant-member-init Avoid unnecessary member initialization
# readability-redundant-preprocessor Avoid redundant preprocessors
# readability-redundant-smartptr-get Avoid doubled dereferencing of smart pointers where single dereference is suggested
# readability-redundant-string-cstr Avoid calls to c_str where it is not necessary
# readability-redundant-string-init Avoid unnecessary string initialization
# readability-simplify-boolean-expr Avoid complex boolean expressions when simple ones are suggested
# readability-simplify-subscript-expr Avoid call to data() where it is not necessary
# readability-static-accessed-through-instance Avoid access of static members through instances
# readability-static-definition-in-anonymous-namespace Avoid unnecessary static in anonymous namespace
# readability-string-compare Ensure string compare function is used where suggested
#xreadability-suspicious-call-argument Not used as too heuristic
# readability-uniqueptr-delete-release Avoid complex deletion of unique pointers
#xreadability-uppercase-literal-suffix Not used, cause lower case is completely valid
# readability-use-anyofallof Avoid use of ranged for loop where special function is suggested
Checks: >
abseil-cleanup-ctad
,abseil-duration-addition
,abseil-duration-comparison
,abseil-duration-conversion-cast
,abseil-duration-division
,abseil-duration-factory-float
,abseil-duration-factory-scale
,abseil-duration-subtraction
,abseil-duration-unnecessary-conversion
,abseil-faster-strsplit-delimiter
,abseil-redundant-strcat-calls
,abseil-str-cat-append
,abseil-string-find-startswith
,abseil-time-comparison
,abseil-time-subtraction
,altera-kernel-name-restriction
,altera-single-work-item-barrier
,boost-use-to-string
,bugprone-argument-comment
,bugprone-assert-side-effect
,bugprone-assignment-in-if-condition
,bugprone-bad-signal-to-kill-thread
,bugprone-bool-pointer-implicit-conversion
,bugprone-branch-clone
,bugprone-copy-constructor-init
,bugprone-dangling-handle
,bugprone-dynamic-static-initializers
,bugprone-fold-init-type
,bugprone-forward-declaration-namespace
,bugprone-forwarding-reference-overload
,bugprone-implicit-widening-of-multiplication-result
,bugprone-inaccurate-erase
,bugprone-incorrect-roundings
,bugprone-infinite-loop
,bugprone-integer-division
,bugprone-lambda-function-name
,bugprone-macro-parentheses
,bugprone-misplaced-operator-in-strlen-in-alloc
,bugprone-misplaced-pointer-arithmetic-in-alloc
,bugprone-misplaced-widening-cast
,bugprone-move-forwarding-reference
,bugprone-multiple-statement-macro
,bugprone-no-escape
,bugprone-not-null-terminated-result
,bugprone-parent-virtual-call
,bugprone-posix-return
,bugprone-redundant-branch-condition
,bugprone-reserved-identifier
,bugprone-shared-ptr-array-mismatch
,bugprone-signal-handler
,bugprone-signed-char-misuse
,bugprone-sizeof-container
,bugprone-sizeof-expression
,bugprone-spuriously-wake-up-functions
,bugprone-standalone-empty
,bugprone-string-constructor
,bugprone-string-integer-assignment
,bugprone-string-literal-with-embedded-nul
,bugprone-stringview-nullptr
,bugprone-suspicious-enum-usage
,bugprone-suspicious-include
,bugprone-suspicious-memory-comparison
,bugprone-suspicious-memset-usage
,bugprone-suspicious-missing-comma
,bugprone-suspicious-realloc-usage
,bugprone-suspicious-semicolon
,bugprone-suspicious-string-compare
,bugprone-swapped-arguments
,bugprone-terminating-continue
,bugprone-throw-keyword-missing
,bugprone-too-small-loop-variable
,bugprone-unchecked-optional-access
,bugprone-undefined-memory-manipulation
,bugprone-undelegated-constructor
,bugprone-unhandled-exception-at-new
,bugprone-unsafe-functions
,bugprone-unused-raii
,bugprone-unused-return-value
,bugprone-use-after-move
,bugprone-virtual-near-miss
,cert-dcl50-cpp
,cert-err34-c
,cert-err52-cpp
,cert-err58-cpp
,cert-err60-cpp
,cert-mem57-cpp
,cert-oop57-cpp
,cert-oop58-cpp
,concurrency-mt-unsafe
,concurrency-thread-canceltype-asynchronous
,cppcoreguidelines-avoid-capture-default-when-capturing-this
,cppcoreguidelines-avoid-capturing-lambda-coroutines
,cppcoreguidelines-avoid-const-or-ref-data-members
,cppcoreguidelines-avoid-goto
,cppcoreguidelines-avoid-non-const-global-variables
,cppcoreguidelines-avoid-reference-coroutine-parameters
,cppcoreguidelines-interfaces-global-init
,cppcoreguidelines-macro-usage
,cppcoreguidelines-narrowing-conversions
,cppcoreguidelines-no-malloc
,cppcoreguidelines-pro-bounds-array-to-pointer-decay
,cppcoreguidelines-pro-bounds-pointer-arithmetic
,cppcoreguidelines-pro-type-const-cast
,cppcoreguidelines-pro-type-cstyle-cast
,cppcoreguidelines-pro-type-member-init
,cppcoreguidelines-pro-type-reinterpret-cast
,cppcoreguidelines-pro-type-static-cast-downcast
,cppcoreguidelines-pro-type-union-access
,cppcoreguidelines-pro-type-vararg
,cppcoreguidelines-rvalue-reference-param-not-moved
,cppcoreguidelines-slicing
,cppcoreguidelines-special-member-functions
,cppcoreguidelines-virtual-class-destructor
,darwin-avoid-spinlock
,darwin-dispatch-once-nonstatic
,google-build-explicit-make-pair
,google-build-namespaces
,google-build-using-namespace
,google-explicit-constructor
,google-global-names-in-headers
,google-readability-casting
,google-upgrade-googletest-case
,hicpp-exception-baseclass
,hicpp-multiway-paths-covered
,hicpp-no-assembler
,llvm-namespace-comment
,misc-confusable-identifiers
,misc-definitions-in-headers
,misc-misleading-bidirectional
,misc-misleading-identifier
,misc-misplaced-const
,misc-new-delete-overloads
,misc-no-recursion
,misc-non-copyable-objects
,misc-redundant-expression
,misc-static-assert
,misc-throw-by-value-catch-by-reference
,misc-unconventional-assign-operator
,misc-uniqueptr-reset-release
,misc-unused-alias-decls
,misc-unused-parameters
,misc-unused-using-decls
,misc-use-anonymous-namespace
,modernize-avoid-bind
,modernize-avoid-c-arrays
,modernize-deprecated-headers
,modernize-deprecated-ios-base-aliases
,modernize-macro-to-enum
,modernize-pass-by-value
,modernize-redundant-void-arg
,modernize-replace-auto-ptr
,modernize-replace-disallow-copy-and-assign-macro
,modernize-replace-random-shuffle
,modernize-shrink-to-fit
,modernize-type-traits
,modernize-unary-static-assert
,modernize-use-bool-literals
,modernize-use-emplace
,modernize-use-equals-default
,modernize-use-equals-delete
,modernize-use-nodiscard
,modernize-use-noexcept
,modernize-use-nullptr
,modernize-use-override
,modernize-use-uncaught-exceptions
,mpi-buffer-deref
,mpi-type-mismatch
,openmp-exception-escape
,openmp-use-default-none
,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-const-arg
,performance-move-constructor-init
,performance-no-automatic-move
,performance-no-int-to-ptr
,performance-noexcept-move-constructor
,performance-trivially-destructible
,performance-type-promotion-in-math-fn
,performance-unnecessary-copy-initialization
,performance-unnecessary-value-param
,portability-simd-intrinsics
,portability-std-allocator-const
,readability-avoid-unconditional-preprocessor-if
,readability-braces-around-statements
,readability-const-return-type
,readability-container-contains
,readability-container-data-pointer
,readability-container-size-empty
,readability-convert-member-functions-to-static
,readability-delete-null-pointer
,readability-duplicate-include
,readability-identifier-naming
,readability-implicit-bool-conversion
,readability-inconsistent-declaration-parameter-name
,readability-isolate-declaration
,readability-magic-numbers
,readability-misleading-indentation
,readability-misplaced-array-index
,readability-named-parameter
,readability-operators-representation
,readability-qualified-auto
,readability-redundant-access-specifiers
,readability-redundant-control-flow
,readability-redundant-declaration
,readability-redundant-function-ptr-dereference
,readability-redundant-member-init
,readability-redundant-preprocessor
,readability-redundant-smartptr-get
,readability-redundant-string-cstr
,readability-redundant-string-init
,readability-simplify-boolean-expr
,readability-simplify-subscript-expr
,readability-static-accessed-through-instance
,readability-static-definition-in-anonymous-namespace
,readability-string-compare
,readability-uniqueptr-delete-release
,readability-use-anyofallof
CheckOptions:
- key: bugprone-argument-comment.StrictMode # Must be the exact parameter name
value: true
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts # Also check implicit casts
value: true
- key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression # Warn when fetching sizeof integer value
value: true
- key: bugprone-string-constructor.WarnOnLargeLength # Large strings are probably intended when encountered
value: true
- key: bugprone-suspicious-enum-usage.StrictMode # Also detect suspicious enums
value: true
- key: bugprone-suspicious-missing-comma.SizeThreshold # Detect all occurencies
value: 0
- key: bugprone-suspicious-missing-comma.RatioThreshold # Detect all occurencies
value: 1.0
- key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens # But not if we got more than x tokens
value: 5
- key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison # Also warn on negation
value: true
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField # Always warn
value: false
- key: cppcoreguidelines-narrowing-conversions.WarnWithinTemplateInstantiation # Also warn on template instantiations
value: true
- key: cppcoreguidelines-narrowing-conversions.PedanticMode # Also warn when assigned value is exactly representable
value: true
- key: cppcoreguidelines-pro-type-member-init.IgnoreArrays # Ignore arrays for performance reason
value: true
- key: cppcoreguidelines-pro-type-member-init.UseAssignment # Use assignment, cause bracket initializer hides information about the called function
value: true
- key: hicpp-multiway-paths-covered.WarnOnMissingElse # Also warn if else branch is not covered
value: true
- key: misc-const-correctness.WarnPointersAsValues # Also warn for pointer values
value: true
- key: misc-const-correctness.TransformPointersAsValues # Also transform for pointer values
value: true
- key: modernize-avoid-bind.PermissiveParameterList # Avoid errors causd by replacement
value: true
- key: performance-for-range-copy.WarnOnAllAutoCopies # Warn when using auto in ranged for loops
value: true
- key: performance-inefficient-string-concatenation.StrictMode # Check everywhere
value: true
- key: portability-simd-intrinsics.Suggest # Suggest alternatives
value: true
- key: readability-identifier-naming.GetConfigPerFile # Use config from where the identifier is defined
value: true
- key: readability-inconsistent-declaration-parameter-name.Strict # Parameters must match exactly
value: true
- key: readability-magic-numbers.IgnoredIntegerValues # Only accept 0 and 1 (for bitwise operation and as true value=
value: '1'
- key: readability-magic-numbers.IgnoredFloatingPointValues # Only accept 0.0 and 1.0 (for 1.0/x)
value: '1.0'
- key: readability-magic-numbers.IgnoreTypeAliases # Ignore in type definitions
value: true
- key: readability-magic-numbers.IgnoreUserDefinedLiterals # Ignore in literal definitions
value: true
- key: readability-redundant-member-init.IgnoreBaseInCopyConstructors # Ignore unnecessary base class initialuization for compiler compatibility
value: true
- key: readability-uniqueptr-delete-release.PreferResetCall # Call reset instead of assigning nullptr
value: true
#Naming conventions
- key: readability-identifier-naming.AbstractClassCase
value: CamelCase
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.ClassMemberCase
value: lower_case
- key: readability-identifier-naming.ClassMethodCase
value: lower_case
- key: readability-identifier-naming.ConstantCase
value: lower_case
- key: readability-identifier-naming.ConstantMemberCase
value: lower_case
- key: readability-identifier-naming.ConstantParameterCase
value: lower_case
- key: readability-identifier-naming.ConstantPointerParameterCase
value: lower_case
- key: readability-identifier-naming.ConstexprMethodCase
value: lower_case
- key: readability-identifier-naming.ConstexprVariableCase
value: UPPER_CASE
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalConstantPointerCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalFunctionCase
value: lower_case
- key: readability-identifier-naming.GlobalPointerCase
value: lower_case
- key: readability-identifier-naming.GlobalVariableCase
value: lower_case
- key: readability-identifier-naming.InlineNamespaceCase
value: lower_case
- key: readability-identifier-naming.LocalConstantCase
value: lower_case
- key: readability-identifier-naming.LocalConstantPointerCase
value: lower_case
- key: readability-identifier-naming.LocalPointerCase
value: lower_case
- key: readability-identifier-naming.LocalVariableCase
value: lower_case
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.MethodCase
value: lower_case
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.ParameterPackCase
value: lower_case
- key: readability-identifier-naming.PointerParameterCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMethodCase
value: lower_case
- key: readability-identifier-naming.ProtectedMemberCase
value: lower_case
- key: readability-identifier-naming.ProtectedMethodCase
value: lower_case
- key: readability-identifier-naming.PublicMemberCase
value: lower_case
- key: readability-identifier-naming.PublicMethodCase
value: lower_case
- key: readability-identifier-naming.ScopedEnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StaticConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StaticVariableCase
value: lower_case
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TemplateTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TypeTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.ValueTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.VirtualMethodCase
value: CamelCase
FormatStyle: file # Use .clang-format for formatting
HeaderFileExtensions: ['h', 'hh', 'hpp', 'hxx', 'cuh'] # All headers, including CUDA headers
ImplementationFileExtensions: ['c', 'cc', 'cpp', 'cxx', 'cu'] # All implementations, including CUDA implementations
InheritParentConfig: true # Inherit parent config if available
#SystemHeaders: false # Ignore system headers
UseColor: true # Use colors if available
WarningsAsErrors: true # Treat all warnings as errors