|
| 1 | +# To run clang-tidy from CMake, build ClickHouse with -DENABLE_CLANG_TIDY=1. To show all warnings, it is |
| 2 | +# recommended to pass "-k0" to Ninja. |
| 3 | + |
| 4 | +# Enable all checks + disable selected checks. Feel free to remove disabled checks from below list if |
| 5 | +# a) the new check is not controversial (this includes many checks in readability-* and google-*) or |
| 6 | +# b) too noisy (checks with > 100 new warnings are considered noisy, this includes e.g. cppcoreguidelines-*). |
| 7 | + |
| 8 | +# TODO Let clang-tidy check headers in further directories |
| 9 | +# --> HeaderFilterRegex: '^.*/(src|base|programs|utils)/.*(h|hpp)$' |
| 10 | +HeaderFilterRegex: '^.*/(base)/.*(h|hpp)$' |
| 11 | + |
| 12 | +Checks: '*, |
| 13 | + -abseil-*, |
| 14 | +
|
| 15 | + -altera-*, |
| 16 | +
|
| 17 | + -android-*, |
| 18 | +
|
| 19 | + -bugprone-assignment-in-if-condition, |
| 20 | + -bugprone-branch-clone, |
| 21 | + -bugprone-easily-swappable-parameters, |
| 22 | + -bugprone-exception-escape, |
| 23 | + -bugprone-implicit-widening-of-multiplication-result, |
| 24 | + -bugprone-narrowing-conversions, |
| 25 | + -bugprone-not-null-terminated-result, |
| 26 | + -bugprone-reserved-identifier, # useful but too slow, TODO retry when https://reviews.llvm.org/rG1c282052624f9d0bd273bde0b47b30c96699c6c7 is merged |
| 27 | + -bugprone-unchecked-optional-access, |
| 28 | +
|
| 29 | + -cert-dcl16-c, |
| 30 | + -cert-dcl37-c, |
| 31 | + -cert-dcl51-cpp, |
| 32 | + -cert-err58-cpp, |
| 33 | + -cert-msc32-c, |
| 34 | + -cert-msc51-cpp, |
| 35 | + -cert-oop54-cpp, |
| 36 | + -cert-oop57-cpp, |
| 37 | +
|
| 38 | + -clang-analyzer-optin.performance.Padding, |
| 39 | + -clang-analyzer-optin.portability.UnixAPI, |
| 40 | + -clang-analyzer-security.insecureAPI.bzero, |
| 41 | + -clang-analyzer-security.insecureAPI.strcpy, |
| 42 | +
|
| 43 | + -cppcoreguidelines-avoid-c-arrays, |
| 44 | + -cppcoreguidelines-avoid-const-or-ref-data-members, |
| 45 | + -cppcoreguidelines-avoid-do-while, |
| 46 | + -cppcoreguidelines-avoid-goto, |
| 47 | + -cppcoreguidelines-avoid-magic-numbers, |
| 48 | + -cppcoreguidelines-avoid-non-const-global-variables, |
| 49 | + -cppcoreguidelines-explicit-virtual-functions, |
| 50 | + -cppcoreguidelines-init-variables, |
| 51 | + -cppcoreguidelines-interfaces-global-init, |
| 52 | + -cppcoreguidelines-macro-usage, |
| 53 | + -cppcoreguidelines-narrowing-conversions, |
| 54 | + -cppcoreguidelines-no-malloc, |
| 55 | + -cppcoreguidelines-non-private-member-variables-in-classes, |
| 56 | + -cppcoreguidelines-owning-memory, |
| 57 | + -cppcoreguidelines-prefer-member-initializer, |
| 58 | + -cppcoreguidelines-pro-bounds-array-to-pointer-decay, |
| 59 | + -cppcoreguidelines-pro-bounds-constant-array-index, |
| 60 | + -cppcoreguidelines-pro-bounds-pointer-arithmetic, |
| 61 | + -cppcoreguidelines-pro-type-const-cast, |
| 62 | + -cppcoreguidelines-pro-type-cstyle-cast, |
| 63 | + -cppcoreguidelines-pro-type-member-init, |
| 64 | + -cppcoreguidelines-pro-type-reinterpret-cast, |
| 65 | + -cppcoreguidelines-pro-type-static-cast-downcast, |
| 66 | + -cppcoreguidelines-pro-type-union-access, |
| 67 | + -cppcoreguidelines-pro-type-vararg, |
| 68 | + -cppcoreguidelines-slicing, |
| 69 | + -cppcoreguidelines-special-member-functions, |
| 70 | +
|
| 71 | + -darwin-*, |
| 72 | +
|
| 73 | + -fuchsia-*, |
| 74 | +
|
| 75 | + -google-build-using-namespace, |
| 76 | + -google-readability-braces-around-statements, |
| 77 | + -google-readability-casting, |
| 78 | + -google-readability-function-size, |
| 79 | + -google-readability-namespace-comments, |
| 80 | + -google-readability-todo, |
| 81 | + -google-upgrade-googletest-case, |
| 82 | +
|
| 83 | + -hicpp-avoid-c-arrays, |
| 84 | + -hicpp-avoid-goto, |
| 85 | + -hicpp-braces-around-statements, |
| 86 | + -hicpp-explicit-conversions, |
| 87 | + -hicpp-function-size, |
| 88 | + -hicpp-member-init, |
| 89 | + -hicpp-move-const-arg, |
| 90 | + -hicpp-multiway-paths-covered, |
| 91 | + -hicpp-named-parameter, |
| 92 | + -hicpp-no-array-decay, |
| 93 | + -hicpp-no-assembler, |
| 94 | + -hicpp-no-malloc, |
| 95 | + -hicpp-signed-bitwise, |
| 96 | + -hicpp-special-member-functions, |
| 97 | + -hicpp-uppercase-literal-suffix, |
| 98 | + -hicpp-use-auto, |
| 99 | + -hicpp-use-emplace, |
| 100 | + -hicpp-vararg, |
| 101 | +
|
| 102 | + -linuxkernel-*, |
| 103 | +
|
| 104 | + -llvm-*, |
| 105 | +
|
| 106 | + -llvmlibc-*, |
| 107 | +
|
| 108 | + -openmp-*, |
| 109 | +
|
| 110 | + -misc-const-correctness, |
| 111 | + -misc-no-recursion, |
| 112 | + -misc-non-private-member-variables-in-classes, |
| 113 | + -misc-confusable-identifiers, # useful but slooow |
| 114 | + -misc-use-anonymous-namespace, |
| 115 | +
|
| 116 | + -modernize-avoid-c-arrays, |
| 117 | + -modernize-concat-nested-namespaces, |
| 118 | + -modernize-macro-to-enum, |
| 119 | + -modernize-pass-by-value, |
| 120 | + -modernize-return-braced-init-list, |
| 121 | + -modernize-use-auto, |
| 122 | + -modernize-use-default-member-init, |
| 123 | + -modernize-use-emplace, |
| 124 | + -modernize-use-nodiscard, |
| 125 | + -modernize-use-override, |
| 126 | + -modernize-use-trailing-return-type, |
| 127 | +
|
| 128 | + -performance-inefficient-string-concatenation, |
| 129 | + -performance-no-int-to-ptr, |
| 130 | + -performance-unnecessary-value-param, |
| 131 | +
|
| 132 | + -portability-simd-intrinsics, |
| 133 | +
|
| 134 | + -readability-braces-around-statements, |
| 135 | + -readability-convert-member-functions-to-static, |
| 136 | + -readability-else-after-return, |
| 137 | + -readability-function-cognitive-complexity, |
| 138 | + -readability-function-size, |
| 139 | + -readability-identifier-length, |
| 140 | + -readability-identifier-naming, # useful but too slow |
| 141 | + -readability-implicit-bool-conversion, |
| 142 | + -readability-isolate-declaration, |
| 143 | + -readability-magic-numbers, |
| 144 | + -readability-named-parameter, |
| 145 | + -readability-redundant-declaration, |
| 146 | + -readability-simplify-boolean-expr, |
| 147 | + -readability-static-accessed-through-instance, |
| 148 | + -readability-suspicious-call-argument, |
| 149 | + -readability-uppercase-literal-suffix, |
| 150 | + -readability-use-anyofallof, |
| 151 | +
|
| 152 | + -zircon-*, |
| 153 | +' |
| 154 | + |
| 155 | +WarningsAsErrors: '*' |
| 156 | + |
| 157 | +CheckOptions: |
| 158 | + readability-identifier-naming.ClassCase: CamelCase |
| 159 | + readability-identifier-naming.EnumCase: CamelCase |
| 160 | + readability-identifier-naming.LocalVariableCase: lower_case |
| 161 | + readability-identifier-naming.StaticConstantCase: aNy_CasE |
| 162 | + readability-identifier-naming.MemberCase: lower_case |
| 163 | + readability-identifier-naming.PrivateMemberPrefix: '' |
| 164 | + readability-identifier-naming.ProtectedMemberPrefix: '' |
| 165 | + readability-identifier-naming.PublicMemberCase: lower_case |
| 166 | + readability-identifier-naming.MethodCase: camelBack |
| 167 | + readability-identifier-naming.PrivateMethodPrefix: '' |
| 168 | + readability-identifier-naming.ProtectedMethodPrefix: '' |
| 169 | + readability-identifier-naming.ParameterPackCase: lower_case |
| 170 | + readability-identifier-naming.StructCase: CamelCase |
| 171 | + readability-identifier-naming.TemplateTemplateParameterCase: CamelCase |
| 172 | + readability-identifier-naming.TemplateParameterCase: lower_case |
| 173 | + readability-identifier-naming.TypeTemplateParameterCase: CamelCase |
| 174 | + readability-identifier-naming.TypedefCase: CamelCase |
| 175 | + readability-identifier-naming.UnionCase: CamelCase |
| 176 | + modernize-loop-convert.UseCxx20ReverseRanges: false |
| 177 | + performance-move-const-arg.CheckTriviallyCopyableMove: false |
| 178 | + # Workaround clang-tidy bug: https://github.com/llvm/llvm-project/issues/46097 |
| 179 | + readability-identifier-naming.TypeTemplateParameterIgnoredRegexp: expr-type |
| 180 | + cppcoreguidelines-avoid-do-while.IgnoreMacros: true |
0 commit comments