-
Notifications
You must be signed in to change notification settings - Fork 371
Expand file tree
/
Copy path.clang-tidy
More file actions
204 lines (202 loc) · 7.48 KB
/
.clang-tidy
File metadata and controls
204 lines (202 loc) · 7.48 KB
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
---
Checks:
"-*\
,boost-*\
,bugprone-*\
,cert-*\
,clang-analyzer-*\
,concurrency-*\
,cppcoreguidelines-*\
,fuchsia-multiple-inheritance\
,google-*\
,hicpp-*\
,misc-*\
,modernize-*\
,performance-*\
,portability-*\
,readability-*\
,-bugprone-unchecked-optional-access\
,-bugprone-easily-swappable-parameters\
,-bugprone-exception-escape\
,-bugprone-implicit-widening-of-multiplication-result\
,-bugprone-lambda-function-name\
,-bugprone-narrowing-conversions\
,-bugprone-use-after-move\
,-cert-dcl21-cpp\
,-cert-err09-cpp\
,-cert-err33-c\
,-cert-err58-cpp\
,-cert-err61-cpp\
,-cert-msc30-c\
,-cert-msc32-c\
,-clang-analyzer-core.uninitialized.Assign\
,-clang-analyzer-optin.cplusplus.VirtualCall\
,-cppcoreguidelines-avoid-c-arrays\
,-cppcoreguidelines-avoid-const-or-ref-data-members\
,-cppcoreguidelines-avoid-do-while\
,-cppcoreguidelines-avoid-goto\
,-cppcoreguidelines-avoid-magic-numbers\
,-cppcoreguidelines-avoid-non-const-global-variables\
,-cppcoreguidelines-c-copy-assignment-signature\
,-cppcoreguidelines-narrowing-conversions\
,-cppcoreguidelines-non-private-member-variables-in-classes\
,-cppcoreguidelines-owning-memory\
,-cppcoreguidelines-pro-bounds-array-to-pointer-decay\
,-cppcoreguidelines-pro-bounds-avoid-unchecked-container-access\
,-cppcoreguidelines-pro-bounds-constant-array-index\
,-cppcoreguidelines-pro-bounds-pointer-arithmetic\
,-cppcoreguidelines-pro-type-reinterpret-cast\
,-cppcoreguidelines-pro-type-union-access\
,-cppcoreguidelines-pro-type-vararg\
,-cppcoreguidelines-special-member-functions\
,-cppcoreguidelines-rvalue-reference-param-not-moved\
,-cppcoreguidelines-virtual-class-destructor\
,-google-explicit-constructor\
,-google-readability-braces-around-statements\
,-google-readability-function-size\
,-google-readability-todo\
,-google-runtime-int\
,-hicpp-avoid-c-arrays\
,-hicpp-avoid-goto\
,-hicpp-braces-around-statements\
,-hicpp-deprecated-headers\
,-hicpp-explicit-conversions\
,-hicpp-function-size\
,-hicpp-invalid-access-moved\
,-hicpp-member-init\
,-hicpp-move-const-arg\
,-hicpp-named-parameter\
,-hicpp-no-array-decay\
,-hicpp-no-malloc\
,-hicpp-noexcept-move\
,-hicpp-signed-bitwise\
,-hicpp-special-member-functions\
,-hicpp-uppercase-literal-suffix\
,-hicpp-vararg\
,-misc-const-correctness\
,-misc-include-cleaner\
,-misc-no-recursion\
,-misc-unconventional-assign-operator\
,-misc-use-anonymous-namespace\
,-misc-override-with-different-visibility\
,-modernize-avoid-c-arrays\
,-modernize-pass-by-value\
,-modernize-return-braced-init-list\
,-modernize-use-designated-initializers\
,-modernize-use-nodiscard\
,-modernize-use-trailing-return-type\
,-performance-move-const-arg\
,-performance-no-int-to-ptr\
,-performance-trivially-destructible\
,-performance-unnecessary-value-param\
,-portability-simd-intrinsics\
,-readability-braces-around-statements\
,-readability-container-contains\
,-readability-convert-member-functions-to-static\
,-readability-else-after-return\
,-readability-function-cognitive-complexity\
,-readability-identifier-length\
,-readability-implicit-bool-conversion\
,-readability-magic-numbers\
,-readability-misleading-indentation\
,-readability-named-parameter\
,-readability-qualified-auto\
,-readability-redundant-declaration\
,-readability-redundant-member-init\
,-readability-simplify-boolean-expr\
,-readability-suspicious-call-argument\
,-readability-uppercase-literal-suffix\
,-readability-use-anyofallof\
,-hicpp-use-emplace\
,-modernize-use-emplace\
"
# WARNING: DO NOT PUT COMMENTS BETWEEN CHECKS ABOVE!
# It will have the effect of silently breaking clang-tidy checks altogether.
WarningsAsErrors: '*'
HeaderFilterRegex: '/userver/(build|clickhouse|core|grpc|mongo|postgresql|redis|kafka|shared|tools)/'
CheckOptions:
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: readability-redundant-access-specifiers.CheckFirstDeclaration
value: '1'
- key: modernize-loop-convert.UseCxx20ReverseRanges
value: 'false'
- key: readability-identifier-naming.ClassCase
value: CamelCase
# Allow DISABLED_CamelCase to skip gtest tests.
- key: readability-identifier-naming.ClassIgnoredRegexp
value: '^DISABLED_([A-Z][a-z]+)+$'
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberSuffix
value: '_'
- key: readability-identifier-naming.ProtectedMemberSuffix
value: '_'
- key: readability-identifier-naming.MethodCase
value: CamelCase
- key: readability-identifier-naming.PublicMethodIgnoredRegexp
value: "(begin|end|empty|size|ysize|front|back|parse|format)"
- key: readability-identifier-naming.FunctionCase
value: CamelCase
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.ParameterPackCase
value: lower_case
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.ConstexprVariableCase
value: CamelCase
- key: readability-identifier-naming.ConstexprVariablePrefix
value: k
# Allow lower_case for constexpr. Probably needs to be reconsidered in the future.
# Allow SimpleExceptionMessage: expands from Y_ENSURE macro.
- key: readability-identifier-naming.ConstexprVariableIgnoredRegexp
value: "^[a-z0-9]+([_]?[a-z0-9]+)*$|^SimpleExceptionMessage$"
- key: readability-identifier-naming.GlobalVariableCase
value: lower_case
# Allow kCamelCase for global variables. Probably needs to be reconsidered in the future.
- key: readability-identifier-naming.GlobalVariableIgnoredRegexp
value: "^k([A-Z]($|[a-z0-9]+))+$"
- key: readability-identifier-naming.GlobalConstantCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantPrefix
value: k
# Allow lower_case for global constants. Probably needs to be reconsidered in the future.
- key: readability-identifier-naming.GlobalConstantIgnoredRegexp
value: "^[a-z0-9]+([_]?[a-z0-9]+)*$"
- key: readability-identifier-naming.StaticConstantCase
value: CamelCase
- key: readability-identifier-naming.StaticConstantPrefix
value: k
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantPrefix
value: k
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.NamespaceCase
value: lower_case
# Allow NCamelCase for NMonitoring.
- key: readability-identifier-naming.NamespaceIgnoredRegexp
value: ^(N([A-Z][a-z]+)+|Headers)$
# Allow kCamelCase.
- key: readability-identifier-naming.ValueTemplateParameterIgnoredRegexp
value: "^k([A-Z]($|[a-z0-9]+))+$"
- key: readability-identifier-naming.ConceptCase
value: CamelCase
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TemplateTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TypedefCase
value: CamelCase
- key: readability-identifier-naming.TypeTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.ValueTemplateParameterCase
value: CamelCase