Skip to content
Snippets Groups Projects
Commit 5fec463b authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

STY: auto-format with clang-format-16

parent 2f3b4b0d
Branches
Tags
2 merge requests!61Release 0.3.0,!57Fix deprecations + updates
Pipeline #55340 failed
This commit is part of merge request !57. Comments created here will be created in the context of that merge request.
Showing with 58 additions and 53 deletions
...@@ -51,8 +51,8 @@ using linkahead::utility::base64_encode; ...@@ -51,8 +51,8 @@ using linkahead::utility::base64_encode;
class Authenticator { class Authenticator {
public: public:
virtual ~Authenticator() = default; virtual ~Authenticator() = default;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto GetCallCredentials() const
GetCallCredentials() const -> std::shared_ptr<grpc::CallCredentials> = 0; -> std::shared_ptr<grpc::CallCredentials> = 0;
}; };
/** /**
......
...@@ -58,8 +58,8 @@ private: ...@@ -58,8 +58,8 @@ private:
public: public:
ConnectionConfiguration(std::string host, int port); ConnectionConfiguration(std::string host, int port);
virtual ~ConnectionConfiguration() = default; virtual ~ConnectionConfiguration() = default;
friend auto operator<<(std::ostream &out, friend auto operator<<(std::ostream &out, const ConnectionConfiguration &configuration)
const ConnectionConfiguration &configuration) -> std::ostream &; -> std::ostream &;
[[nodiscard]] auto virtual ToString() const -> std::string = 0; [[nodiscard]] auto virtual ToString() const -> std::string = 0;
[[nodiscard]] auto GetHost() const -> std::string; [[nodiscard]] auto GetHost() const -> std::string;
...@@ -125,16 +125,16 @@ public: ...@@ -125,16 +125,16 @@ public:
/** /**
* See mGetConnectionConfiguration. * See mGetConnectionConfiguration.
*/ */
inline static auto inline static auto GetConnectionConfiguration(const std::string &name)
GetConnectionConfiguration(const std::string &name) -> std::unique_ptr<ConnectionConfiguration> { -> std::unique_ptr<ConnectionConfiguration> {
return GetInstance().mGetConnectionConfiguration(name); return GetInstance().mGetConnectionConfiguration(name);
} }
/** /**
* Return the ConnectionConfiguration for the default connection. * Return the ConnectionConfiguration for the default connection.
*/ */
inline static auto inline static auto GetDefaultConnectionConfiguration()
GetDefaultConnectionConfiguration() -> std::unique_ptr<ConnectionConfiguration> { -> std::unique_ptr<ConnectionConfiguration> {
return GetInstance().mGetConnectionConfiguration(GetInstance().mGetDefaultConnectionName()); return GetInstance().mGetConnectionConfiguration(GetInstance().mGetDefaultConnectionName());
} }
......
...@@ -111,8 +111,8 @@ public: ...@@ -111,8 +111,8 @@ public:
*/ */
// TODO(tf) find a way to deal with this: // TODO(tf) find a way to deal with this:
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters) // NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
[[nodiscard]] auto RetrieveSingleUser(const std::string &realm, [[nodiscard]] auto RetrieveSingleUser(const std::string &realm, const std::string &name) const
const std::string &name) const -> User; -> User;
/** /**
* Create a new user. * Create a new user.
......
...@@ -226,8 +226,8 @@ public: ...@@ -226,8 +226,8 @@ public:
* If the file cannot be downloaded due to unsufficient permissions an error * If the file cannot be downloaded due to unsufficient permissions an error
* is appended. * is appended.
*/ */
auto RetrieveAndDownloadFileById(const std::string &id, auto RetrieveAndDownloadFileById(const std::string &id, const std::string &local_path) noexcept
const std::string &local_path) noexcept -> StatusCode; -> StatusCode;
/** /**
* Add an entity id to this transaction for retrieval. * Add an entity id to this transaction for retrieval.
...@@ -479,8 +479,8 @@ private: ...@@ -479,8 +479,8 @@ private:
}; };
template <class InputIterator> template <class InputIterator>
inline auto Transaction::RetrieveById(InputIterator begin, inline auto Transaction::RetrieveById(InputIterator begin, InputIterator end) noexcept
InputIterator end) noexcept -> StatusCode { -> StatusCode {
ASSERT_CAN_ADD_RETRIEVAL ASSERT_CAN_ADD_RETRIEVAL
auto next = begin; auto next = begin;
......
...@@ -194,8 +194,8 @@ public: ...@@ -194,8 +194,8 @@ public:
TransactionStatus::ThrowExceptionIfError(this->code, this->description); TransactionStatus::ThrowExceptionIfError(this->code, this->description);
} }
inline static auto ThrowExceptionIfError(StatusCode code, inline static auto ThrowExceptionIfError(StatusCode code, const std::string &description)
const std::string &description) -> void { -> void {
if (!IsError(code)) { if (!IsError(code)) {
return; return;
} }
......
...@@ -88,8 +88,8 @@ inline auto get_env_fallback(const char *key, const char *fallback) -> const cha ...@@ -88,8 +88,8 @@ inline auto get_env_fallback(const char *key, const char *fallback) -> const cha
* @brief Return the value of an environment variable or - if undefined - the * @brief Return the value of an environment variable or - if undefined - the
* fallback value. * fallback value.
*/ */
inline auto get_env_fallback(const std::string &key, inline auto get_env_fallback(const std::string &key, const std::string &fallback)
const std::string &fallback) -> const std::string { -> const std::string {
const char *val = get_env_fallback(key.c_str(), fallback.c_str()); const char *val = get_env_fallback(key.c_str(), fallback.c_str());
auto const result = std::string(val); auto const result = std::string(val);
......
...@@ -38,10 +38,11 @@ using linkahead::utility::base64_encode; ...@@ -38,10 +38,11 @@ using linkahead::utility::base64_encode;
MetadataCredentialsPluginImpl::MetadataCredentialsPluginImpl(std::string key, std::string value) MetadataCredentialsPluginImpl::MetadataCredentialsPluginImpl(std::string key, std::string value)
: key(std::move(key)), value(std::move(value)) {} : key(std::move(key)), value(std::move(value)) {}
auto MetadataCredentialsPluginImpl::GetMetadata( auto MetadataCredentialsPluginImpl::GetMetadata(string_ref /*service_url*/,
string_ref /*service_url*/, string_ref /*method_name*/, string_ref /*method_name*/,
const AuthContext & /*channel_auth_context*/, const AuthContext & /*channel_auth_context*/,
std::multimap<grpc::string, grpc::string> *metadata) -> Status { std::multimap<grpc::string, grpc::string> *metadata)
-> Status {
metadata->insert(std::make_pair(this->key, this->value)); metadata->insert(std::make_pair(this->key, this->value));
return Status::OK; return Status::OK;
......
...@@ -76,8 +76,8 @@ class ResultTableImpl : public ScalarProtoMessageWrapper<ProtoSelectQueryResult> ...@@ -76,8 +76,8 @@ class ResultTableImpl : public ScalarProtoMessageWrapper<ProtoSelectQueryResult>
friend class ResultTable; friend class ResultTable;
friend class ResultTable::HeaderIterator; friend class ResultTable::HeaderIterator;
friend class ResultTableColumn; friend class ResultTableColumn;
friend auto friend auto ProcessSelectResponse(ProtoSelectQueryResult *select_result)
ProcessSelectResponse(ProtoSelectQueryResult *select_result) -> std::unique_ptr<ResultTable>; -> std::unique_ptr<ResultTable>;
}; };
} // namespace linkahead::transaction } // namespace linkahead::transaction
......
...@@ -75,8 +75,9 @@ auto Transaction::RetrieveById(const std::string &id) noexcept -> StatusCode { ...@@ -75,8 +75,9 @@ auto Transaction::RetrieveById(const std::string &id) noexcept -> StatusCode {
return this->status.GetCode(); return this->status.GetCode();
} }
auto Transaction::RetrieveAndDownloadFileById( auto Transaction::RetrieveAndDownloadFileById(const std::string &id,
const std::string &id, const std::string &local_path) noexcept -> StatusCode { const std::string &local_path) noexcept
-> StatusCode {
ASSERT_CAN_ADD_RETRIEVAL ASSERT_CAN_ADD_RETRIEVAL
auto *retrieve_request = this->request->add_requests()->mutable_retrieve_request(); auto *retrieve_request = this->request->add_requests()->mutable_retrieve_request();
...@@ -293,9 +294,10 @@ auto ProcessSelectResponse(ProtoSelectQueryResult *select_result) -> std::unique ...@@ -293,9 +294,10 @@ auto ProcessSelectResponse(ProtoSelectQueryResult *select_result) -> std::unique
return ResultTableImpl::create(select_result); return ResultTableImpl::create(select_result);
} }
auto Transaction::ProcessRetrieveResponse( auto Transaction::ProcessRetrieveResponse(RetrieveResponse *retrieve_response,
RetrieveResponse *retrieve_response, std::vector<std::unique_ptr<Entity>> *entities, std::vector<std::unique_ptr<Entity>> *entities,
bool *set_error) const noexcept -> std::unique_ptr<Entity> { bool *set_error) const noexcept
-> std::unique_ptr<Entity> {
std::unique_ptr<Entity> result; std::unique_ptr<Entity> result;
switch (retrieve_response->retrieve_response_case()) { switch (retrieve_response->retrieve_response_case()) {
case RetrieveResponseCase::kEntityResponse: { case RetrieveResponseCase::kEntityResponse: {
......
...@@ -737,11 +737,13 @@ TEST(test_entity, test_remove_property) { ...@@ -737,11 +737,13 @@ TEST(test_entity, test_remove_property) {
entity.AppendProperty(property10); entity.AppendProperty(property10);
ASSERT_EQ(entity.GetProperties().size(), 9); ASSERT_EQ(entity.GetProperties().size(), 9);
std::cout << "[" << "\n"; std::cout << "["
<< "\n";
for (int i = 0; i < 9; i++) { for (int i = 0; i < 9; i++) {
std::cout << " " << entity.GetProperties().at(i).GetName() << ",\n"; std::cout << " " << entity.GetProperties().at(i).GetName() << ",\n";
} }
std::cout << "]" << "\n"; std::cout << "]"
<< "\n";
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
auto name = "PROPERTY-" + std::to_string(i); auto name = "PROPERTY-" + std::to_string(i);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment