Skip to content

Commit 7d7b2f4

Browse files
author
aselutin
committed
feat userver: change code style to ya style
commit_hash:d93bd13b6e00b4a4e59b0e31f6c6a63b8765c9b7
1 parent af94aa9 commit 7d7b2f4

File tree

1,855 files changed

+23576
-12142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,855 files changed

+23576
-12142
lines changed

.clang-format

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,30 @@ BasedOnStyle: Google
22
DerivePointerAlignment: false
33
IncludeBlocks: Preserve
44
AttributeMacros: ["noexcept"]
5-
IndentRequires: false
5+
IndentRequiresClause: false
66
ColumnLimit: 120
77
IndentWidth: 4
88
TabWidth: 4
99
AccessModifierOffset: -4
1010
BinPackParameters: false
1111
BinPackArguments: false
12-
AllowAllParametersOfDeclarationOnNextLine: false
1312
AlignAfterOpenBracket: BlockIndent
1413
AlwaysBreakAfterDefinitionReturnType: None
15-
PenaltyReturnTypeOnItsOwnLine: 200
14+
AllowAllParametersOfDeclarationOnNextLine: false
15+
AllowAllArgumentsOnNextLine: false
16+
BreakBeforeBraces: Custom
17+
BraceWrapping:
18+
AfterControlStatement: MultiLine
19+
PenaltyBreakOpenParenthesis: 5000000
20+
PenaltyIndentedWhitespace: 100000
21+
PenaltyBreakFirstLessLess: 0
22+
PenaltyBreakScopeResolution: 20000000
23+
PenaltyBreakAssignment: 10000
24+
PenaltyExcessCharacter: 1000000000
25+
PenaltyBreakBeforeFirstCallParameter: 1
26+
PenaltyReturnTypeOnItsOwnLine: 10000000
27+
InsertBraces: true
28+
IndentWrappedFunctionNames: false
29+
30+
# Use unpatched ContinuationIndenter, remove this line if you use vanilla clang-format code
31+
VanillaContinuationIndenter: true

chaotic-openapi/golden_tests/output/include/client/test/component.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ class Component final : public USERVER_NAMESPACE::components::LoggableComponentB
3030
} // namespace clients::test
3131

3232
template <>
33-
inline constexpr auto USERVER_NAMESPACE::components::kConfigFileMode<::clients::test::Component> =
34-
USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;
33+
inline constexpr auto USERVER_NAMESPACE::components::kConfigFileMode<
34+
::clients::test::Component> = USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;

chaotic-openapi/golden_tests/output/src/client/test/client_impl.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ ClientImpl::ClientImpl(
1111
const USERVER_NAMESPACE::chaotic::openapi::client::Config& config,
1212
USERVER_NAMESPACE::clients::http::Client& http_client
1313
)
14-
: config_(config), http_client_(http_client) {}
14+
: config_(config),
15+
http_client_(http_client)
16+
{}
1517

1618
USERVER_NAMESPACE::yaml_config::Schema ClientImpl::GetStaticConfigSchema() {
1719
std::string base_schema = R"(
@@ -56,9 +58,8 @@ additionalProperties: false
5658

5759
std::string combined_schema = base_schema + middlewares_yaml;
5860

59-
return USERVER_NAMESPACE::yaml_config::MergeSchemas<USERVER_NAMESPACE::components::LoggableComponentBase>(
60-
combined_schema
61-
);
61+
return USERVER_NAMESPACE::yaml_config::MergeSchemas<
62+
USERVER_NAMESPACE::components::LoggableComponentBase>(combined_schema);
6263
}
6364

6465
testme_post::Response ClientImpl::TestmePost(
@@ -73,8 +74,8 @@ testme_post::Response ClientImpl::TestmePost(
7374
if (command_control) {
7475
auto it = middlewares_.find("timeout_retry");
7576
if (it != middlewares_.end() && (command_control.timeout.count() > 0 || command_control.attempts > 0)) {
76-
auto timeout_retry =
77-
std::dynamic_pointer_cast<USERVER_NAMESPACE::chaotic::openapi::TimeoutRetryMiddleware>(it->second);
77+
auto timeout_retry = std::dynamic_pointer_cast<
78+
USERVER_NAMESPACE::chaotic::openapi::TimeoutRetryMiddleware>(it->second);
7879
if (timeout_retry) {
7980
timeout_retry->ApplyCommandControl(
8081
command_control.timeout.count() > 0 ? command_control.timeout : config_.timeout,
@@ -85,8 +86,8 @@ testme_post::Response ClientImpl::TestmePost(
8586

8687
it = middlewares_.find("follow_redirects");
8788
if (it != middlewares_.end() && command_control.follow_redirects) {
88-
auto follow_redirects =
89-
std::dynamic_pointer_cast<USERVER_NAMESPACE::chaotic::openapi::FollowRedirectsMiddleware>(it->second);
89+
auto follow_redirects = std::dynamic_pointer_cast<
90+
USERVER_NAMESPACE::chaotic::openapi::FollowRedirectsMiddleware>(it->second);
9091
if (follow_redirects) {
9192
follow_redirects->ApplyFollowRedirects(*command_control.follow_redirects);
9293
}

chaotic-openapi/golden_tests/output/src/client/test/component.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Component::Component(
1515
client_(
1616
USERVER_NAMESPACE::chaotic::openapi::client::ParseConfig(config, ClientImpl::kDefaultBaseUrl),
1717
context.FindComponent<USERVER_NAMESPACE::components::HttpClient>().GetHttpClient()
18-
) {
18+
)
19+
{
1920
if (config.HasMember("middlewares")) {
2021
const auto& mw_config = config["middlewares"];
2122
const auto& registry = USERVER_NAMESPACE::chaotic::openapi::client::MiddlewareRegistry::Instance();

chaotic-openapi/golden_tests/output/src/client/test/exceptions.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ std::string_view Exception::HandleInfo() const noexcept { return kHandleInfo; }
2323

2424
HttpException::~HttpException() = default;
2525

26-
TimeoutException::TimeoutException() : HttpException(USERVER_NAMESPACE::clients::http::ErrorKind::kTimeout) {}
26+
TimeoutException::TimeoutException()
27+
: HttpException(USERVER_NAMESPACE::clients::http::ErrorKind::kTimeout)
28+
{}
2729

2830
TimeoutException::~TimeoutException() = default;
2931

chaotic-openapi/golden_tests/output/src/client/test/requests.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ static constexpr openapi::Name karray = "array";
2222
void SerializeRequest(const Request& request, USERVER_NAMESPACE::clients::http::Request& http_request) {
2323
openapi::ParameterSinkHttpClient sink(http_request, "/testme");
2424

25-
openapi::WriteParameter<openapi::TrivialParameter<openapi::In::kQuery, knumber, std::string, std::string>>(
26-
request.number, sink
27-
);
25+
openapi::WriteParameter<
26+
openapi::TrivialParameter<openapi::In::kQuery, knumber, std::string, std::string>>(request.number, sink);
2827

29-
openapi::WriteParameter<openapi::ArrayParameter<openapi::In::kQuery, karray, ',', std::string, std::string>>(
30-
request.array, sink
31-
);
28+
openapi::WriteParameter<
29+
openapi::ArrayParameter<openapi::In::kQuery, karray, ',', std::string, std::string>>(request.array, sink);
3230

3331
// http_request.data(ToJsonString(request.body));
3432
http_request.data(ToString(USERVER_NAMESPACE::formats::json::ValueBuilder(request.body).ExtractValue()));

chaotic-openapi/include/userver/chaotic/openapi/middlewares/logging_middleware.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ class LoggingMiddlewareFactory final : public client::MiddlewareFactory {
4242
USERVER_NAMESPACE_END
4343

4444
template <>
45-
inline constexpr auto
46-
USERVER_NAMESPACE::components::kConfigFileMode<USERVER_NAMESPACE::chaotic::openapi::LoggingMiddlewareFactory> =
47-
USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;
45+
inline constexpr auto USERVER_NAMESPACE::components::kConfigFileMode<
46+
USERVER_NAMESPACE::chaotic::openapi::LoggingMiddlewareFactory> =
47+
USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;

chaotic-openapi/include/userver/chaotic/openapi/middlewares/proxy_middleware.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ class ProxyMiddlewareFactory final : public client::MiddlewareFactory {
3939
USERVER_NAMESPACE_END
4040

4141
template <>
42-
inline constexpr auto
43-
USERVER_NAMESPACE::components::kConfigFileMode<USERVER_NAMESPACE::chaotic::openapi::ProxyMiddlewareFactory> =
44-
USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;
42+
inline constexpr auto USERVER_NAMESPACE::components::kConfigFileMode<
43+
USERVER_NAMESPACE::chaotic::openapi::ProxyMiddlewareFactory> =
44+
USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;

chaotic-openapi/include/userver/chaotic/openapi/middlewares/qos_middleware.hpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ class QosMiddlewareFactory final : public client::MiddlewareFactory {
4747
};
4848

4949
template <ConfigKey& Key>
50-
QosMiddlewareFactory<Key>::QosMiddlewareFactory(
51-
const components::ComponentConfig& config,
52-
const components::ComponentContext& context
53-
)
50+
QosMiddlewareFactory<
51+
Key>::QosMiddlewareFactory(const components::ComponentConfig& config, const components::ComponentContext& context)
5452
: client::MiddlewareFactory(config, context),
55-
config_source_(context.FindComponent<components::DynamicConfig>().GetSource()) {}
53+
config_source_(context.FindComponent<components::DynamicConfig>().GetSource())
54+
{}
5655

5756
template <ConfigKey& Key>
5857
std::shared_ptr<client::Middleware> QosMiddlewareFactory<Key>::Create(const yaml_config::YamlConfig&) {
@@ -69,6 +68,6 @@ std::string QosMiddlewareFactory<Key>::GetStaticConfigSchemaStr() {
6968
USERVER_NAMESPACE_END
7069

7170
template <USERVER_NAMESPACE::chaotic::openapi::ConfigKey& Key>
72-
inline constexpr auto
73-
USERVER_NAMESPACE::components::kConfigFileMode<USERVER_NAMESPACE::chaotic::openapi::QosMiddlewareFactory<Key>> =
74-
USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;
71+
inline constexpr auto USERVER_NAMESPACE::components::kConfigFileMode<
72+
USERVER_NAMESPACE::chaotic::openapi::QosMiddlewareFactory<Key>> =
73+
USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;

chaotic-openapi/include/userver/chaotic/openapi/middlewares/ssl_middleware.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ class SslMiddlewareFactory final : public client::MiddlewareFactory {
3838
USERVER_NAMESPACE_END
3939

4040
template <>
41-
inline constexpr auto
42-
USERVER_NAMESPACE::components::kConfigFileMode<USERVER_NAMESPACE::chaotic::openapi::SslMiddlewareFactory> =
43-
USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;
41+
inline constexpr auto USERVER_NAMESPACE::components::kConfigFileMode<
42+
USERVER_NAMESPACE::chaotic::openapi::SslMiddlewareFactory> =
43+
USERVER_NAMESPACE::components::ConfigFileMode::kNotRequired;

0 commit comments

Comments
 (0)