|
5 | 5 | # a) the new check is not controversial (this includes many checks in readability-* and google-*) or |
6 | 6 | # b) too noisy (checks with > 100 new warnings are considered noisy, this includes e.g. cppcoreguidelines-*). |
7 | 7 |
|
8 | | -# TODO: Once clang(-tidy) 17 is the minimum, we can convert this list to YAML |
9 | | -# See https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/ReleaseNotes.html#improvements-to-clang-tidy |
10 | | - |
11 | | -# TODO Let clang-tidy check headers in further directories |
12 | | -# --> HeaderFilterRegex: '^.*/(src|base|programs|utils)/.*(h|hpp)$' |
13 | | -HeaderFilterRegex: '^.*/(base)/.*(h|hpp)$' |
14 | | - |
15 | | -Checks: '*, |
16 | | - -abseil-*, |
17 | | -
|
18 | | - -altera-*, |
19 | | -
|
20 | | - -android-*, |
21 | | -
|
22 | | - -bugprone-assignment-in-if-condition, |
23 | | - -bugprone-branch-clone, |
24 | | - -bugprone-easily-swappable-parameters, |
25 | | - -bugprone-exception-escape, |
26 | | - -bugprone-implicit-widening-of-multiplication-result, |
27 | | - -bugprone-narrowing-conversions, |
28 | | - -bugprone-not-null-terminated-result, |
29 | | - -bugprone-reserved-identifier, # useful but too slow, TODO retry when https://reviews.llvm.org/rG1c282052624f9d0bd273bde0b47b30c96699c6c7 is merged |
30 | | - -bugprone-unchecked-optional-access, |
31 | | -
|
32 | | - -cert-dcl16-c, |
33 | | - -cert-dcl37-c, |
34 | | - -cert-dcl51-cpp, |
35 | | - -cert-err58-cpp, |
36 | | - -cert-msc32-c, |
37 | | - -cert-msc51-cpp, |
38 | | - -cert-oop54-cpp, |
39 | | - -cert-oop57-cpp, |
40 | | -
|
41 | | - -clang-analyzer-unix.Malloc, |
42 | | -
|
43 | | - -cppcoreguidelines-*, # impractical in a codebase as large as ClickHouse, also slow |
44 | | -
|
45 | | - -darwin-*, |
46 | | -
|
47 | | - -fuchsia-*, |
48 | | -
|
49 | | - -google-build-using-namespace, |
50 | | - -google-readability-braces-around-statements, |
51 | | - -google-readability-casting, |
52 | | - -google-readability-function-size, |
53 | | - -google-readability-namespace-comments, |
54 | | - -google-readability-todo, |
55 | | -
|
56 | | - -hicpp-avoid-c-arrays, |
57 | | - -hicpp-avoid-goto, |
58 | | - -hicpp-braces-around-statements, |
59 | | - -hicpp-explicit-conversions, |
60 | | - -hicpp-function-size, |
61 | | - -hicpp-member-init, |
62 | | - -hicpp-move-const-arg, |
63 | | - -hicpp-multiway-paths-covered, |
64 | | - -hicpp-named-parameter, |
65 | | - -hicpp-no-array-decay, |
66 | | - -hicpp-no-assembler, |
67 | | - -hicpp-no-malloc, |
68 | | - -hicpp-signed-bitwise, |
69 | | - -hicpp-special-member-functions, |
70 | | - -hicpp-uppercase-literal-suffix, |
71 | | - -hicpp-use-auto, |
72 | | - -hicpp-use-emplace, |
73 | | - -hicpp-vararg, |
74 | | -
|
75 | | - -linuxkernel-*, |
76 | | -
|
77 | | - -llvm-*, |
78 | | -
|
79 | | - -llvmlibc-*, |
80 | | -
|
81 | | - -openmp-*, |
82 | | -
|
83 | | - -misc-const-correctness, |
84 | | - -misc-include-cleaner, # useful but far too many occurrences |
85 | | - -misc-no-recursion, |
86 | | - -misc-non-private-member-variables-in-classes, |
87 | | - -misc-confusable-identifiers, # useful but slooow |
88 | | - -misc-use-anonymous-namespace, |
89 | | -
|
90 | | - -modernize-avoid-c-arrays, |
91 | | - -modernize-concat-nested-namespaces, |
92 | | - -modernize-macro-to-enum, |
93 | | - -modernize-pass-by-value, |
94 | | - -modernize-return-braced-init-list, |
95 | | - -modernize-use-auto, |
96 | | - -modernize-use-default-member-init, |
97 | | - -modernize-use-emplace, |
98 | | - -modernize-use-nodiscard, |
99 | | - -modernize-use-override, |
100 | | - -modernize-use-trailing-return-type, |
101 | | -
|
102 | | - -performance-inefficient-string-concatenation, |
103 | | - -performance-no-int-to-ptr, |
104 | | - -performance-avoid-endl, |
105 | | - -performance-unnecessary-value-param, |
106 | | -
|
107 | | - -portability-simd-intrinsics, |
108 | | -
|
109 | | - -readability-avoid-unconditional-preprocessor-if, |
110 | | - -readability-braces-around-statements, |
111 | | - -readability-convert-member-functions-to-static, |
112 | | - -readability-else-after-return, |
113 | | - -readability-function-cognitive-complexity, |
114 | | - -readability-function-size, |
115 | | - -readability-identifier-length, |
116 | | - -readability-identifier-naming, # useful but too slow |
117 | | - -readability-implicit-bool-conversion, |
118 | | - -readability-isolate-declaration, |
119 | | - -readability-magic-numbers, |
120 | | - -readability-named-parameter, |
121 | | - -readability-redundant-declaration, |
122 | | - -readability-simplify-boolean-expr, |
123 | | - -readability-static-accessed-through-instance, |
124 | | - -readability-suspicious-call-argument, |
125 | | - -readability-uppercase-literal-suffix, |
126 | | - -readability-use-anyofallof, |
127 | | -
|
128 | | - -zircon-*, |
129 | | -' |
| 8 | +HeaderFilterRegex: '^.*/(base|src|programs|utils)/.*(h|hpp)$' |
| 9 | + |
| 10 | +Checks: [ |
| 11 | + '*', |
| 12 | + |
| 13 | + '-abseil-string-find-str-contains', # disabled to avoid a misleading suggestion (obsolete absl::StrContains() instead of C++23 std::string::contains()) |
| 14 | + |
| 15 | + '-altera-*', |
| 16 | + |
| 17 | + '-android-*', |
| 18 | + |
| 19 | + '-boost-use-ranges', |
| 20 | + |
| 21 | + '-bugprone-assignment-in-if-condition', |
| 22 | + '-bugprone-branch-clone', |
| 23 | + '-bugprone-easily-swappable-parameters', |
| 24 | + '-bugprone-exception-escape', |
| 25 | + '-bugprone-implicit-widening-of-multiplication-result', |
| 26 | + '-bugprone-multi-level-implicit-pointer-conversion', |
| 27 | + '-bugprone-narrowing-conversions', |
| 28 | + '-bugprone-unchecked-optional-access', |
| 29 | + '-bugprone-crtp-constructor-accessibility', |
| 30 | + '-bugprone-not-null-terminated-result', |
| 31 | + |
| 32 | + '-cert-dcl16-c', |
| 33 | + '-cert-err58-cpp', |
| 34 | + |
| 35 | + '-clang-analyzer-optin.performance.Padding', |
| 36 | + |
| 37 | + '-cppcoreguidelines-*', # impractical in a codebase as large as ClickHouse, also slow |
| 38 | + |
| 39 | + '-darwin-*', |
| 40 | + |
| 41 | + '-fuchsia-*', |
| 42 | + |
| 43 | + '-google-build-using-namespace', |
| 44 | + '-google-readability-braces-around-statements', |
| 45 | + '-google-readability-casting', |
| 46 | + '-google-readability-function-size', |
| 47 | + '-google-readability-namespace-comments', |
| 48 | + '-google-readability-todo', |
| 49 | + |
| 50 | + '-hicpp-avoid-c-arrays', |
| 51 | + '-hicpp-avoid-goto', |
| 52 | + '-hicpp-braces-around-statements', |
| 53 | + '-hicpp-explicit-conversions', |
| 54 | + '-hicpp-function-size', |
| 55 | + '-hicpp-member-init', |
| 56 | + '-hicpp-move-const-arg', |
| 57 | + '-hicpp-multiway-paths-covered', |
| 58 | + '-hicpp-named-parameter', |
| 59 | + '-hicpp-no-array-decay', |
| 60 | + '-hicpp-no-assembler', |
| 61 | + '-hicpp-no-malloc', |
| 62 | + '-hicpp-signed-bitwise', |
| 63 | + '-hicpp-special-member-functions', |
| 64 | + '-hicpp-uppercase-literal-suffix', |
| 65 | + '-hicpp-use-auto', |
| 66 | + '-hicpp-use-emplace', |
| 67 | + '-hicpp-vararg', |
| 68 | + |
| 69 | + '-llvm-*', |
| 70 | + |
| 71 | + '-llvmlibc-*', |
| 72 | + |
| 73 | + '-misc-const-correctness', |
| 74 | + '-misc-include-cleaner', # useful but far too many occurrences |
| 75 | + '-misc-no-recursion', |
| 76 | + '-misc-non-private-member-variables-in-classes', |
| 77 | + '-misc-use-anonymous-namespace', |
| 78 | + '-misc-use-internal-linkage', |
| 79 | + |
| 80 | + '-modernize-avoid-c-arrays', |
| 81 | + '-modernize-concat-nested-namespaces', |
| 82 | + '-modernize-pass-by-value', |
| 83 | + '-modernize-return-braced-init-list', |
| 84 | + '-modernize-use-auto', |
| 85 | + '-modernize-use-default-member-init', |
| 86 | + '-modernize-use-emplace', |
| 87 | + '-modernize-use-nodiscard', |
| 88 | + '-modernize-use-ranges', |
| 89 | + '-modernize-use-trailing-return-type', |
| 90 | + '-modernize-use-designated-initializers', |
| 91 | + |
| 92 | + '-performance-avoid-endl', |
| 93 | + '-performance-enum-size', |
| 94 | + '-performance-inefficient-string-concatenation', |
| 95 | + '-performance-inefficient-vector-operation', |
| 96 | + '-performance-no-int-to-ptr', |
| 97 | + '-performance-unnecessary-value-param', |
| 98 | + |
| 99 | + '-portability-simd-intrinsics', |
| 100 | + |
| 101 | + '-readability-avoid-nested-conditional-operator', |
| 102 | + '-readability-avoid-unconditional-preprocessor-if', |
| 103 | + '-readability-braces-around-statements', |
| 104 | + '-readability-convert-member-functions-to-static', |
| 105 | + '-readability-else-after-return', |
| 106 | + '-readability-function-cognitive-complexity', |
| 107 | + '-readability-function-size', |
| 108 | + '-readability-identifier-length', |
| 109 | + '-readability-identifier-naming', # useful but too slow |
| 110 | + '-readability-implicit-bool-conversion', |
| 111 | + '-readability-magic-numbers', |
| 112 | + '-readability-named-parameter', |
| 113 | + '-readability-redundant-declaration', |
| 114 | + '-readability-redundant-inline-specifier', # useful but incompatible with __attribute((always_inline))__ (aka. ALWAYS_INLINE, base/base/defines.h). |
| 115 | + # ALWAYS_INLINE only has an effect if combined with `inline`: https://godbolt.org/z/Eefd74qdM |
| 116 | + '-readability-redundant-member-init', # Useful but triggers another problem. Imagine a struct S with multiple String members. Structs are often instantiated via designated |
| 117 | + # initializer S s{.s1 = [...], .s2 = [...], [...]}. In this case, compiler warning `missing-field-initializers` requires to specify all members which are not in-struct |
| 118 | + # initialized (example: s1 in struct S { String s1; String s2{};}; is not in-struct initialized, therefore it must be specified at instantiation time). As explicitly |
| 119 | + # specifying all members is tedious for large structs, `missing-field-initializers` makes programmers initialize as many members as possible in-struct. Clang-tidy |
| 120 | + # warning `readability-redundant-member-init` does the opposite thing, both are not compatible with each other. |
| 121 | + '-readability-simplify-boolean-expr', |
| 122 | + '-readability-suspicious-call-argument', |
| 123 | + '-readability-uppercase-literal-suffix', |
| 124 | + '-readability-use-anyofallof', |
| 125 | + '-readability-math-missing-parentheses', |
| 126 | + |
| 127 | + '-zircon-*' |
| 128 | +] |
130 | 129 |
|
131 | 130 | WarningsAsErrors: '*' |
132 | 131 |
|
|
0 commit comments