2022-08-26 13:54:57 +00:00
|
|
|
# To run clang-tidy from CMake, build ClickHouse with -DENABLE_CLANG_TIDY=1. To show all warnings, it is
|
|
|
|
# recommended to pass "-k0" to Ninja.
|
|
|
|
|
2022-10-04 15:29:33 +00:00
|
|
|
# Enable all checks + disable selected checks. Feel free to remove disabled checks from below list if
|
2022-05-19 15:39:53 +00:00
|
|
|
# a) the new check is not controversial (this includes many checks in readability-* and google-*) or
|
|
|
|
# b) too noisy (checks with > 100 new warnings are considered noisy, this includes e.g. cppcoreguidelines-*).
|
2022-08-26 13:54:57 +00:00
|
|
|
|
|
|
|
# TODO Let clang-tidy check headers in further directories
|
|
|
|
# --> HeaderFilterRegex: '^.*/(src|base|programs|utils)/.*(h|hpp)$'
|
|
|
|
HeaderFilterRegex: '^.*/(base)/.*(h|hpp)$'
|
|
|
|
|
2022-05-04 17:24:02 +00:00
|
|
|
Checks: '*,
|
|
|
|
-abseil-*,
|
|
|
|
|
|
|
|
-altera-*,
|
|
|
|
|
|
|
|
-android-*,
|
|
|
|
|
2022-12-02 09:17:05 +00:00
|
|
|
-bugprone-assignment-in-if-condition,
|
2022-05-04 17:24:02 +00:00
|
|
|
-bugprone-branch-clone,
|
|
|
|
-bugprone-easily-swappable-parameters,
|
|
|
|
-bugprone-exception-escape,
|
|
|
|
-bugprone-implicit-widening-of-multiplication-result,
|
|
|
|
-bugprone-narrowing-conversions,
|
|
|
|
-bugprone-not-null-terminated-result,
|
2023-03-14 22:24:20 +00:00
|
|
|
-bugprone-reserved-identifier,
|
2022-09-10 07:58:49 +00:00
|
|
|
-bugprone-unchecked-optional-access,
|
2022-05-04 17:24:02 +00:00
|
|
|
|
2022-05-05 07:50:57 +00:00
|
|
|
-cert-dcl16-c,
|
2023-03-14 22:24:20 +00:00
|
|
|
-cert-dcl37-c,
|
|
|
|
-cert-dcl51-cpp,
|
2022-05-04 17:24:02 +00:00
|
|
|
-cert-err58-cpp,
|
2022-05-05 07:50:57 +00:00
|
|
|
-cert-msc32-c,
|
2022-05-04 17:24:02 +00:00
|
|
|
-cert-msc51-cpp,
|
|
|
|
-cert-oop54-cpp,
|
|
|
|
-cert-oop57-cpp,
|
|
|
|
|
2022-05-05 10:44:08 +00:00
|
|
|
-clang-analyzer-optin.performance.Padding,
|
2022-05-05 07:50:57 +00:00
|
|
|
-clang-analyzer-optin.portability.UnixAPI,
|
2022-05-04 17:24:02 +00:00
|
|
|
-clang-analyzer-security.insecureAPI.bzero,
|
|
|
|
-clang-analyzer-security.insecureAPI.strcpy,
|
|
|
|
|
2022-05-16 15:44:19 +00:00
|
|
|
-cppcoreguidelines-avoid-c-arrays,
|
2023-03-19 16:23:46 +00:00
|
|
|
-cppcoreguidelines-avoid-const-or-ref-data-members,
|
|
|
|
-cppcoreguidelines-avoid-do-while,
|
2022-05-16 15:44:19 +00:00
|
|
|
-cppcoreguidelines-avoid-goto,
|
|
|
|
-cppcoreguidelines-avoid-magic-numbers,
|
|
|
|
-cppcoreguidelines-avoid-non-const-global-variables,
|
|
|
|
-cppcoreguidelines-explicit-virtual-functions,
|
|
|
|
-cppcoreguidelines-init-variables,
|
|
|
|
-cppcoreguidelines-interfaces-global-init,
|
|
|
|
-cppcoreguidelines-macro-usage,
|
|
|
|
-cppcoreguidelines-narrowing-conversions,
|
|
|
|
-cppcoreguidelines-no-malloc,
|
|
|
|
-cppcoreguidelines-non-private-member-variables-in-classes,
|
|
|
|
-cppcoreguidelines-owning-memory,
|
|
|
|
-cppcoreguidelines-prefer-member-initializer,
|
|
|
|
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
|
|
|
-cppcoreguidelines-pro-bounds-constant-array-index,
|
|
|
|
-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-slicing,
|
|
|
|
-cppcoreguidelines-special-member-functions,
|
2022-05-04 17:24:02 +00:00
|
|
|
|
|
|
|
-darwin-*,
|
|
|
|
|
|
|
|
-fuchsia-*,
|
|
|
|
|
|
|
|
-google-build-using-namespace,
|
|
|
|
-google-readability-braces-around-statements,
|
2022-05-16 10:03:26 +00:00
|
|
|
-google-readability-casting,
|
2022-05-05 07:50:57 +00:00
|
|
|
-google-readability-function-size,
|
2022-05-04 17:24:02 +00:00
|
|
|
-google-readability-namespace-comments,
|
|
|
|
-google-readability-todo,
|
|
|
|
-google-upgrade-googletest-case,
|
|
|
|
|
|
|
|
-hicpp-avoid-c-arrays,
|
|
|
|
-hicpp-avoid-goto,
|
|
|
|
-hicpp-braces-around-statements,
|
2022-05-05 07:50:57 +00:00
|
|
|
-hicpp-explicit-conversions,
|
|
|
|
-hicpp-function-size,
|
2022-05-04 17:24:02 +00:00
|
|
|
-hicpp-member-init,
|
|
|
|
-hicpp-move-const-arg,
|
|
|
|
-hicpp-multiway-paths-covered,
|
|
|
|
-hicpp-named-parameter,
|
|
|
|
-hicpp-no-array-decay,
|
|
|
|
-hicpp-no-assembler,
|
|
|
|
-hicpp-no-malloc,
|
|
|
|
-hicpp-signed-bitwise,
|
|
|
|
-hicpp-special-member-functions,
|
|
|
|
-hicpp-uppercase-literal-suffix,
|
|
|
|
-hicpp-use-auto,
|
|
|
|
-hicpp-use-emplace,
|
|
|
|
-hicpp-vararg,
|
|
|
|
|
2022-05-16 15:44:19 +00:00
|
|
|
-linuxkernel-*,
|
|
|
|
|
2022-05-04 17:24:02 +00:00
|
|
|
-llvm-*,
|
|
|
|
|
|
|
|
-llvmlibc-*,
|
|
|
|
|
|
|
|
-openmp-*,
|
|
|
|
|
2022-12-02 09:17:05 +00:00
|
|
|
-misc-const-correctness,
|
2022-05-04 17:24:02 +00:00
|
|
|
-misc-no-recursion,
|
|
|
|
-misc-non-private-member-variables-in-classes,
|
|
|
|
|
|
|
|
-modernize-avoid-c-arrays,
|
|
|
|
-modernize-concat-nested-namespaces,
|
2022-12-02 09:17:05 +00:00
|
|
|
-modernize-macro-to-enum,
|
2022-05-04 17:24:02 +00:00
|
|
|
-modernize-pass-by-value,
|
|
|
|
-modernize-return-braced-init-list,
|
|
|
|
-modernize-use-auto,
|
|
|
|
-modernize-use-default-member-init,
|
|
|
|
-modernize-use-emplace,
|
|
|
|
-modernize-use-nodiscard,
|
|
|
|
-modernize-use-override,
|
|
|
|
-modernize-use-trailing-return-type,
|
|
|
|
|
|
|
|
-performance-inefficient-string-concatenation,
|
|
|
|
-performance-no-int-to-ptr,
|
|
|
|
-performance-unnecessary-value-param,
|
|
|
|
|
2022-05-05 10:44:08 +00:00
|
|
|
-portability-simd-intrinsics,
|
|
|
|
|
2022-05-04 17:24:02 +00:00
|
|
|
-readability-braces-around-statements,
|
2023-03-19 16:23:46 +00:00
|
|
|
-readability-convert-member-functions-to-static,
|
2022-05-04 17:24:02 +00:00
|
|
|
-readability-else-after-return,
|
|
|
|
-readability-function-cognitive-complexity,
|
|
|
|
-readability-function-size,
|
2022-05-16 14:20:23 +00:00
|
|
|
-readability-identifier-length,
|
2023-03-14 22:24:20 +00:00
|
|
|
-readability-identifier-naming,
|
2022-05-04 17:24:02 +00:00
|
|
|
-readability-implicit-bool-conversion,
|
|
|
|
-readability-isolate-declaration,
|
|
|
|
-readability-magic-numbers,
|
|
|
|
-readability-named-parameter,
|
|
|
|
-readability-redundant-declaration,
|
2022-12-02 09:17:05 +00:00
|
|
|
-readability-simplify-boolean-expr,
|
2022-05-04 17:24:02 +00:00
|
|
|
-readability-static-accessed-through-instance,
|
|
|
|
-readability-suspicious-call-argument,
|
|
|
|
-readability-uppercase-literal-suffix,
|
|
|
|
-readability-use-anyofallof,
|
|
|
|
|
|
|
|
-zirkon-*,
|
2022-12-02 09:18:05 +00:00
|
|
|
|
|
|
|
-misc-*, # temporarily disabled due to being too slow
|
|
|
|
# also disable checks in other categories which are aliases of checks in misc-*:
|
|
|
|
# https://releases.llvm.org/15.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/list.html
|
|
|
|
-cert-dcl54-cpp, # alias of misc-new-delete-overloads
|
|
|
|
-hicpp-new-delete-operators, # alias of misc-new-delete-overloads
|
|
|
|
-cert-fio38-c, # alias of misc-non-copyable-objects
|
|
|
|
-cert-dcl03-c, # alias of misc-static-assert
|
|
|
|
-hicpp-static-assert, # alias of misc-static-assert
|
|
|
|
-cert-err09-cpp, # alias of misc-throw-by-value-catch-by-reference
|
|
|
|
-cert-err61-cpp, # alias of misc-throw-by-value-catch-by-reference
|
|
|
|
-cppcoreguidelines-c-copy-assignment-signature, # alias of misc-unconventional-assign-operator
|
|
|
|
-cppcoreguidelines-non-private-member-variables-in-classes, # alias of misc-non-private-member-variables-in-classes
|
2020-03-18 00:57:00 +00:00
|
|
|
'
|
2022-05-04 17:24:02 +00:00
|
|
|
|
2020-03-08 20:17:49 +00:00
|
|
|
WarningsAsErrors: '*'
|
2020-03-23 02:12:31 +00:00
|
|
|
|
|
|
|
CheckOptions:
|
2023-03-16 16:59:24 +00:00
|
|
|
readability-identifier-naming.ClassCase: CamelCase
|
2023-03-16 13:49:27 +00:00
|
|
|
readability-identifier-naming.EnumCase: CamelCase
|
|
|
|
readability-identifier-naming.LocalVariableCase: lower_case
|
|
|
|
readability-identifier-naming.StaticConstantCase: aNy_CasE
|
|
|
|
readability-identifier-naming.MemberCase: lower_case
|
|
|
|
readability-identifier-naming.PrivateMemberPrefix: ''
|
|
|
|
readability-identifier-naming.ProtectedMemberPrefix: ''
|
|
|
|
readability-identifier-naming.PublicMemberCase: lower_case
|
|
|
|
readability-identifier-naming.MethodCase: camelBack
|
|
|
|
readability-identifier-naming.PrivateMethodPrefix: ''
|
|
|
|
readability-identifier-naming.ProtectedMethodPrefix: ''
|
|
|
|
readability-identifier-naming.ParameterPackCase: lower_case
|
|
|
|
readability-identifier-naming.StructCase: CamelCase
|
|
|
|
readability-identifier-naming.TemplateTemplateParameterCase: CamelCase
|
|
|
|
readability-identifier-naming.TemplateUsingCase: lower_case
|
|
|
|
readability-identifier-naming.TypeTemplateParameterCase: CamelCase
|
|
|
|
readability-identifier-naming.TypedefCase: CamelCase
|
|
|
|
readability-identifier-naming.UnionCase: CamelCase
|
|
|
|
readability-identifier-naming.UsingCase: CamelCase
|
|
|
|
modernize-loop-convert.UseCxx20ReverseRanges: false
|
|
|
|
performance-move-const-arg.CheckTriviallyCopyableMove: false
|
|
|
|
# Workaround clang-tidy bug: https://github.com/llvm/llvm-project/issues/46097
|
|
|
|
readability-identifier-naming.TypeTemplateParameterIgnoredRegexp: expr-type
|
|
|
|
cppcoreguidelines-avoid-do-while.IgnoreMacros: true
|