diff --git a/include/linkahead/authentication.h b/include/linkahead/authentication.h index c09fe4261096e1850383b59dcfd2b4797b120961..2770bcfdda5fbef96e8005f9e723a3f84358e333 100644 --- a/include/linkahead/authentication.h +++ b/include/linkahead/authentication.h @@ -51,8 +51,8 @@ using linkahead::utility::base64_encode; class Authenticator { public: virtual ~Authenticator() = default; - [[nodiscard]] virtual auto - GetCallCredentials() const -> std::shared_ptr<grpc::CallCredentials> = 0; + [[nodiscard]] virtual auto GetCallCredentials() const + -> std::shared_ptr<grpc::CallCredentials> = 0; }; /** diff --git a/include/linkahead/configuration.h b/include/linkahead/configuration.h index d86658a57bfa16491f5a19096cb1ab098b4d966e..bdb87fd3f8133485649af3561fb065455f7a993f 100644 --- a/include/linkahead/configuration.h +++ b/include/linkahead/configuration.h @@ -58,8 +58,8 @@ private: public: ConnectionConfiguration(std::string host, int port); virtual ~ConnectionConfiguration() = default; - friend auto operator<<(std::ostream &out, - const ConnectionConfiguration &configuration) -> std::ostream &; + friend auto operator<<(std::ostream &out, const ConnectionConfiguration &configuration) + -> std::ostream &; [[nodiscard]] auto virtual ToString() const -> std::string = 0; [[nodiscard]] auto GetHost() const -> std::string; @@ -125,16 +125,16 @@ public: /** * See mGetConnectionConfiguration. */ - inline static auto - GetConnectionConfiguration(const std::string &name) -> std::unique_ptr<ConnectionConfiguration> { + inline static auto GetConnectionConfiguration(const std::string &name) + -> std::unique_ptr<ConnectionConfiguration> { return GetInstance().mGetConnectionConfiguration(name); } /** * Return the ConnectionConfiguration for the default connection. */ - inline static auto - GetDefaultConnectionConfiguration() -> std::unique_ptr<ConnectionConfiguration> { + inline static auto GetDefaultConnectionConfiguration() + -> std::unique_ptr<ConnectionConfiguration> { return GetInstance().mGetConnectionConfiguration(GetInstance().mGetDefaultConnectionName()); } @@ -156,7 +156,7 @@ private: static ConfigurationManager mInstance; inline ConfigurationManager() noexcept - : json_configuration(nullptr) { + : json_configuration(nullptr){ // InitializeDefaults(); }; diff --git a/include/linkahead/connection.h b/include/linkahead/connection.h index f3c5564a21d1da0133a4c8ce30ce15952a019b31..1f47a421cc123688051a45514fcffaf94179d9c7 100644 --- a/include/linkahead/connection.h +++ b/include/linkahead/connection.h @@ -111,8 +111,8 @@ public: */ // TODO(tf) find a way to deal with this: // NOLINTNEXTLINE(bugprone-easily-swappable-parameters) - [[nodiscard]] auto RetrieveSingleUser(const std::string &realm, - const std::string &name) const -> User; + [[nodiscard]] auto RetrieveSingleUser(const std::string &realm, const std::string &name) const + -> User; /** * Create a new user. diff --git a/include/linkahead/entity.h b/include/linkahead/entity.h index e4dae827af903cd17d2cc8bf6373ce7218c0cffc..fd08014634a1a650b6fd3c4cac3e64a6e39e8890 100644 --- a/include/linkahead/entity.h +++ b/include/linkahead/entity.h @@ -157,7 +157,7 @@ public: friend class Entity; - virtual ~RepeatedPtrFieldWrapper() {}; + virtual ~RepeatedPtrFieldWrapper(){}; inline auto ToString() const noexcept -> const std::string override { if (this->size() == 0) { @@ -202,7 +202,7 @@ public: } protected: - RepeatedPtrFieldWrapper() : ProtoMessageWrapper<RepeatedPtrField<P>>() {}; + RepeatedPtrFieldWrapper() : ProtoMessageWrapper<RepeatedPtrField<P>>(){}; explicit inline RepeatedPtrFieldWrapper(RepeatedPtrField<P> *wrapped) : ProtoMessageWrapper<RepeatedPtrField<P>>(wrapped) {} @@ -349,7 +349,7 @@ public: private: explicit inline Message(ProtoMessage *wrapped) - : ScalarProtoMessageWrapper<ProtoMessage>(wrapped) {}; + : ScalarProtoMessageWrapper<ProtoMessage>(wrapped){}; }; /** @@ -363,7 +363,7 @@ public: // friend class Property; private: - inline Messages() : RepeatedPtrFieldWrapper<Message, ProtoMessage>() {}; + inline Messages() : RepeatedPtrFieldWrapper<Message, ProtoMessage>(){}; }; /////////////////////////////////////////////////////////////////////////////// @@ -378,8 +378,8 @@ private: */ class Parent : public ScalarProtoMessageWrapper<ProtoParent> { public: - explicit inline Parent(ProtoParent *wrapped) : ScalarProtoMessageWrapper<ProtoParent>(wrapped) {}; - Parent() : ScalarProtoMessageWrapper<ProtoParent>() {}; + explicit inline Parent(ProtoParent *wrapped) : ScalarProtoMessageWrapper<ProtoParent>(wrapped){}; + Parent() : ScalarProtoMessageWrapper<ProtoParent>(){}; ~Parent() = default; /** @@ -481,9 +481,9 @@ public: friend class Entity; private: - inline Parents() : RepeatedPtrFieldWrapper<Parent, ProtoParent>() {}; + inline Parents() : RepeatedPtrFieldWrapper<Parent, ProtoParent>(){}; explicit inline Parents(::google::protobuf::RepeatedPtrField<caosdb::entity::v1::Parent> *wrapped) - : RepeatedPtrFieldWrapper<Parent, ProtoParent>(wrapped) {}; + : RepeatedPtrFieldWrapper<Parent, ProtoParent>(wrapped){}; }; /////////////////////////////////////////////////////////////////////////////// @@ -522,10 +522,10 @@ public: value(this->wrapped->has_value() ? this->wrapped->mutable_value() : static_cast<ProtoValue *>(nullptr)), data_type(this->wrapped->has_data_type() ? this->wrapped->mutable_data_type() - : static_cast<ProtoDataType *>(nullptr)) {}; + : static_cast<ProtoDataType *>(nullptr)){}; inline Property() : ScalarProtoMessageWrapper<ProtoProperty>(), value(static_cast<ProtoValue *>(nullptr)), - data_type(static_cast<ProtoDataType *>(nullptr)) {}; + data_type(static_cast<ProtoDataType *>(nullptr)){}; ~Property() = default; @@ -666,9 +666,9 @@ public: friend class Entity; private: - inline Properties() {}; + inline Properties(){}; explicit inline Properties(RepeatedPtrField<ProtoProperty> *wrapped) - : RepeatedPtrFieldWrapper<Property, ProtoProperty>(wrapped) {}; + : RepeatedPtrFieldWrapper<Property, ProtoProperty>(wrapped){}; }; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/linkahead/info.h b/include/linkahead/info.h index be613b25cd2c927c1fadeeb01a3f49f9e730aa2d..237564a7a6f61f01dd2de073542a13465911a585 100644 --- a/include/linkahead/info.h +++ b/include/linkahead/info.h @@ -53,7 +53,7 @@ public: * LinkAheadConnection::GetVersionInfo() instead to get the version of the * server behind the given connection. */ - explicit inline VersionInfo(ProtoVersionInfo *info) : info(info) {}; + explicit inline VersionInfo(ProtoVersionInfo *info) : info(info){}; [[nodiscard]] inline auto GetMajor() const -> int32_t { return this->info->major(); } [[nodiscard]] inline auto GetMinor() const -> int32_t { return this->info->minor(); } [[nodiscard]] inline auto GetPatch() const -> int32_t { return this->info->patch(); } diff --git a/include/linkahead/logging.h b/include/linkahead/logging.h index 3bafc9304162ebc094d725d0f0babe861751061b..3b70c1a203178e383d8ba286749427c8fb811158 100644 --- a/include/linkahead/logging.h +++ b/include/linkahead/logging.h @@ -88,7 +88,7 @@ private: */ class LevelConfiguration { public: - LevelConfiguration(int level) : level(level) {}; + LevelConfiguration(int level) : level(level){}; [[nodiscard]] inline auto GetLevel() const -> int { return this->level; } private: diff --git a/include/linkahead/transaction.h b/include/linkahead/transaction.h index 19becfc0a6770e4bad0bf265737e910a842c2454..84e7829edf61a071328e7e7824367a00c2cee9c8 100644 --- a/include/linkahead/transaction.h +++ b/include/linkahead/transaction.h @@ -226,8 +226,8 @@ public: * If the file cannot be downloaded due to unsufficient permissions an error * is appended. */ - auto RetrieveAndDownloadFileById(const std::string &id, - const std::string &local_path) noexcept -> StatusCode; + auto RetrieveAndDownloadFileById(const std::string &id, const std::string &local_path) noexcept + -> StatusCode; /** * Add an entity id to this transaction for retrieval. @@ -479,8 +479,8 @@ private: }; template <class InputIterator> -inline auto Transaction::RetrieveById(InputIterator begin, - InputIterator end) noexcept -> StatusCode { +inline auto Transaction::RetrieveById(InputIterator begin, InputIterator end) noexcept + -> StatusCode { ASSERT_CAN_ADD_RETRIEVAL auto next = begin; diff --git a/include/linkahead/transaction_status.h b/include/linkahead/transaction_status.h index 83d53ddaba584586fa82b79108c238dfc52c5555..6ef62a95c8484d02d60ca08636bead78d3c96544 100644 --- a/include/linkahead/transaction_status.h +++ b/include/linkahead/transaction_status.h @@ -40,7 +40,7 @@ using linkahead::exceptions::TransactionTypeError; * Define static factory method in the TransactionStatus class. */ #define LINKAHEAD_TRANSACTION_STATUS_DEFAULT_FACTORY(_StatusName, _StatusCode) \ - inline static auto _StatusName() -> const TransactionStatus & { \ + inline static auto _StatusName()->const TransactionStatus & { \ static const TransactionStatus instance(_StatusCode, \ linkahead::get_status_description(_StatusCode)); \ return instance; \ @@ -194,8 +194,8 @@ public: TransactionStatus::ThrowExceptionIfError(this->code, this->description); } - inline static auto ThrowExceptionIfError(StatusCode code, - const std::string &description) -> void { + inline static auto ThrowExceptionIfError(StatusCode code, const std::string &description) + -> void { if (!IsError(code)) { return; } @@ -243,7 +243,7 @@ public: inline auto GetCode() const -> StatusCode { return this->code; } TransactionStatus(StatusCode code, const std::string &description) - : code(code), description(description) {}; + : code(code), description(description){}; private: /** diff --git a/include/linkahead/utility.h b/include/linkahead/utility.h index faaabe67c28ce0407251f5518aca73f72fc591ca..1b739d7e9f0a919df2501c6e8a0fb981407447be 100644 --- a/include/linkahead/utility.h +++ b/include/linkahead/utility.h @@ -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 * fallback value. */ -inline auto get_env_fallback(const std::string &key, - const std::string &fallback) -> const std::string { +inline auto get_env_fallback(const std::string &key, const std::string &fallback) + -> const std::string { const char *val = get_env_fallback(key.c_str(), fallback.c_str()); auto const result = std::string(val); diff --git a/include/linkahead/value.h b/include/linkahead/value.h index d87f5043a22fd90c944d7125be1f32770d0c5821..78407a3f418a44e26d8f6ee50e751437e072bae2 100644 --- a/include/linkahead/value.h +++ b/include/linkahead/value.h @@ -170,7 +170,7 @@ public: /** * Destructor. */ - inline ~ScalarValue() {}; + inline ~ScalarValue(){}; /** * Copy constructor. */ @@ -180,7 +180,7 @@ public: /** * Move constructor. */ - inline ScalarValue(ScalarValue &&other) : ScalarValue(std::move(other.wrapped)) {}; + inline ScalarValue(ScalarValue &&other) : ScalarValue(std::move(other.wrapped)){}; /** * Copy assignment operator. */ diff --git a/src/linkahead/acm/user.cpp b/src/linkahead/acm/user.cpp index 392c7e60fcc9ed1d1ca5833367e600d5f2f5c775..39c88f1501a13f55d2f3a81e0a6f37f7ef679c1b 100644 --- a/src/linkahead/acm/user.cpp +++ b/src/linkahead/acm/user.cpp @@ -19,9 +19,9 @@ * */ #include "linkahead/acm/user.h" -#include "linkahead/acm/user_impl.h" // for UserImpl +#include "linkahead/acm/user_impl.h" // for UserImpl #include "caosdb/acm/v1alpha1/main.pb.h" // for ProtoUser -#include "linkahead/protobuf_helper.h" // for ProtoMessageWrapper +#include "linkahead/protobuf_helper.h" // for ProtoMessageWrapper #include <utility> // for move namespace linkahead::acm { diff --git a/src/linkahead/acm/user_impl.h b/src/linkahead/acm/user_impl.h index 5cbe1ab8796970b8bd5eb830b31f5ce5e9cf0359..3ba072f0f4fa6052c3d8028fe68327a2eafefda0 100644 --- a/src/linkahead/acm/user_impl.h +++ b/src/linkahead/acm/user_impl.h @@ -20,7 +20,7 @@ */ #include "linkahead/acm/user.h" #include "caosdb/acm/v1alpha1/main.pb.h" // for ProtoUser -#include "linkahead/protobuf_helper.h" // for ProtoMessageWrapper +#include "linkahead/protobuf_helper.h" // for ProtoMessageWrapper #include <memory> // for unique_ptr #include <utility> // for move diff --git a/src/linkahead/authentication.cpp b/src/linkahead/authentication.cpp index feafae4057d1c4a52bc160b35fe45ef0e519a3e4..bebe747e32018e99a63b68337852016b38292e1c 100644 --- a/src/linkahead/authentication.cpp +++ b/src/linkahead/authentication.cpp @@ -38,10 +38,11 @@ using linkahead::utility::base64_encode; MetadataCredentialsPluginImpl::MetadataCredentialsPluginImpl(std::string key, std::string value) : key(std::move(key)), value(std::move(value)) {} -auto MetadataCredentialsPluginImpl::GetMetadata( - string_ref /*service_url*/, string_ref /*method_name*/, - const AuthContext & /*channel_auth_context*/, - std::multimap<grpc::string, grpc::string> *metadata) -> Status { +auto MetadataCredentialsPluginImpl::GetMetadata(string_ref /*service_url*/, + string_ref /*method_name*/, + const AuthContext & /*channel_auth_context*/, + std::multimap<grpc::string, grpc::string> *metadata) + -> Status { metadata->insert(std::make_pair(this->key, this->value)); return Status::OK; diff --git a/src/linkahead/result_table_impl.h b/src/linkahead/result_table_impl.h index 9c68fc1c7d4da7b00773adb725d12787128d92a2..62d7fa1c67c4d9b9ec2d0ce2c6e6cb6856701040 100644 --- a/src/linkahead/result_table_impl.h +++ b/src/linkahead/result_table_impl.h @@ -76,8 +76,8 @@ class ResultTableImpl : public ScalarProtoMessageWrapper<ProtoSelectQueryResult> friend class ResultTable; friend class ResultTable::HeaderIterator; friend class ResultTableColumn; - friend auto - ProcessSelectResponse(ProtoSelectQueryResult *select_result) -> std::unique_ptr<ResultTable>; + friend auto ProcessSelectResponse(ProtoSelectQueryResult *select_result) + -> std::unique_ptr<ResultTable>; }; } // namespace linkahead::transaction diff --git a/src/linkahead/transaction.cpp b/src/linkahead/transaction.cpp index 7abd06e566bf97bc7793bb97a0c27cc273befdaa..5fafb34b67cbb4324cd178e83184948d19a77cee 100644 --- a/src/linkahead/transaction.cpp +++ b/src/linkahead/transaction.cpp @@ -75,8 +75,9 @@ auto Transaction::RetrieveById(const std::string &id) noexcept -> StatusCode { return this->status.GetCode(); } -auto Transaction::RetrieveAndDownloadFileById( - const std::string &id, const std::string &local_path) noexcept -> StatusCode { +auto Transaction::RetrieveAndDownloadFileById(const std::string &id, + const std::string &local_path) noexcept + -> StatusCode { ASSERT_CAN_ADD_RETRIEVAL auto *retrieve_request = this->request->add_requests()->mutable_retrieve_request(); @@ -293,9 +294,10 @@ auto ProcessSelectResponse(ProtoSelectQueryResult *select_result) -> std::unique return ResultTableImpl::create(select_result); } -auto Transaction::ProcessRetrieveResponse( - RetrieveResponse *retrieve_response, std::vector<std::unique_ptr<Entity>> *entities, - bool *set_error) const noexcept -> std::unique_ptr<Entity> { +auto Transaction::ProcessRetrieveResponse(RetrieveResponse *retrieve_response, + std::vector<std::unique_ptr<Entity>> *entities, + bool *set_error) const noexcept + -> std::unique_ptr<Entity> { std::unique_ptr<Entity> result; switch (retrieve_response->retrieve_response_case()) { case RetrieveResponseCase::kEntityResponse: { diff --git a/test/test_entity.cpp b/test/test_entity.cpp index 857e662defab29dd4ead4657a1c759ec17378022..3eab1a764d5834b70129cd308387af327b5cfb97 100644 --- a/test/test_entity.cpp +++ b/test/test_entity.cpp @@ -737,11 +737,13 @@ TEST(test_entity, test_remove_property) { entity.AppendProperty(property10); ASSERT_EQ(entity.GetProperties().size(), 9); - std::cout << "[" << "\n"; + std::cout << "[" + << "\n"; for (int i = 0; i < 9; i++) { std::cout << " " << entity.GetProperties().at(i).GetName() << ",\n"; } - std::cout << "]" << "\n"; + std::cout << "]" + << "\n"; for (int i = 0; i < 3; i++) { auto name = "PROPERTY-" + std::to_string(i);