From 3fcda597b2c12420fbd964671099ea6ff9fcceca Mon Sep 17 00:00:00 2001 From: "Andreas C. Osowski" Date: Thu, 19 Apr 2018 10:03:20 +0200 Subject: [PATCH] sqlpp: include order issue fixed upstream --- .clang-format | 2 +- WORKSPACE | 98 +++++++++++++++++--------- hub/commands/create_user.cc | 7 +- hub/commands/create_user.h | 5 +- hub/commands/get_balance.cc | 6 +- hub/commands/get_balance.h | 5 +- hub/commands/helper.cc | 16 ++--- hub/commands/tests/test_create_user.cc | 2 +- hub/commands/tests/test_get_balance.cc | 4 +- 9 files changed, 89 insertions(+), 56 deletions(-) diff --git a/.clang-format b/.clang-format index 393de71..d83d6e4 100644 --- a/.clang-format +++ b/.clang-format @@ -97,7 +97,7 @@ RawStringFormats: Language: TextProto BasedOnStyle: google ReflowComments: true -SortIncludes: false +SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: true diff --git a/WORKSPACE b/WORKSPACE index be09384..fbbe893 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,27 +1,48 @@ workspace(name="org_iota_hub") -git_repository(name="org_pubref_rules_protobuf", - remote="https://github.com/pubref/rules_protobuf", - tag="v0.8.2") -git_repository(name="com_github_gflags_gflags", - commit="e292e0452fcfd5a8ae055b59052fc041cbab4abf", - remote="https://github.com/gflags/gflags.git") -git_repository(name="com_github_google_glog", - commit="2f493d292c92abf16ebd46cfd0cc0bf8eef5724d", - remote="https://github.com/google/glog.git") -git_repository(name="com_google_googletest", - commit="fdb57f85710ccb17076acb1870a881964f5e04af", - remote="https://github.com/google/googletest.git") - -new_git_repository(name="hinnant_date", - remote="https://github.com/HowardHinnant/date.git", - commit="e5c69d84ab5db3e06170b8eedec1d87841c7fb22", - build_file="BUILD.date") - -new_git_repository(name="sqlpp11", - remote="https://github.com/rbock/sqlpp11.git", - commit="1b12fddb7a0fa23f9abd07bef86a7ad010568573", - build_file="BUILD.sqlpp11") +# Global config + +# EXTERNAL RULES +git_repository( + name="org_pubref_rules_protobuf", + remote="https://github.com/pubref/rules_protobuf", + tag="v0.8.2") +http_archive( + name="io_bazel_rules_go", + url= + "https://github.com/bazelbuild/rules_go/releases/download/0.11.0/rules_go-0.11.0.tar.gz", + sha256="f70c35a8c779bb92f7521ecb5a1c6604e9c3edd431e50b6376d7497abc8ad3c1", +) +git_repository( + name="com_github_nelhage_rules_boost", + commit="69e96e724cbe746f63d993fa8f6bf772e1ebc5cc", + remote="https://github.com/nelhage/rules_boost", ) + +# DEPENDENCIES +git_repository( + name="com_github_gflags_gflags", + commit="e292e0452fcfd5a8ae055b59052fc041cbab4abf", + remote="https://github.com/gflags/gflags.git") +git_repository( + name="com_github_google_glog", + commit="2f493d292c92abf16ebd46cfd0cc0bf8eef5724d", + remote="https://github.com/google/glog.git") +git_repository( + name="com_google_googletest", + commit="fdb57f85710ccb17076acb1870a881964f5e04af", + remote="https://github.com/google/googletest.git") + +new_git_repository( + name="hinnant_date", + remote="https://github.com/HowardHinnant/date.git", + commit="e5c69d84ab5db3e06170b8eedec1d87841c7fb22", + build_file="BUILD.date") + +new_git_repository( + name="sqlpp11", + remote="https://github.com/rbock/sqlpp11.git", + commit="9d64a5c7411f84cad1da71b23118634b5a62a063", + build_file="BUILD.sqlpp11") new_git_repository( name="sqlpp11sqlite", @@ -29,10 +50,6 @@ new_git_repository( commit="8d4ea283fa891c3f1eb7e45d012bdd4c0838e13a", build_file="BUILD.sqlpp11sqlite") -git_repository(name="com_github_nelhage_rules_boost", - commit="69e96e724cbe746f63d993fa8f6bf772e1ebc5cc", - remote="https://github.com/nelhage/rules_boost", ) - new_http_archive( name="libsodium", url="https://github.com/jedisct1/libsodium/archive/1.0.16.tar.gz", @@ -40,18 +57,31 @@ new_http_archive( sha256="0c14604bbeab2e82a803215d65c3b6e74bb28291aaee6236d65c699ccfe1a98c", build_file="BUILD.libsodium") -new_git_repository(name="azmq", - remote="https://github.com/zeromq/azmq.git", - commit="a8f54cc8c9672da7d6301fe1d2719b1436ab4816", - build_file="BUILD.azmq") +new_git_repository( + name="azmq", + remote="https://github.com/zeromq/azmq.git", + commit="a8f54cc8c9672da7d6301fe1d2719b1436ab4816", + build_file="BUILD.azmq") -new_git_repository(name="libzmq", - remote="https://github.com/zeromq/libzmq.git", - tag="v4.2.5", - build_file="BUILD.libzmq", ) +new_git_repository( + name="libzmq", + remote="https://github.com/zeromq/libzmq.git", + tag="v4.2.5", + build_file="BUILD.libzmq", ) load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps") boost_deps() load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cpp_proto_repositories") cpp_proto_repositories() + +load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", + "go_register_toolchains") +go_rules_dependencies() +go_register_toolchains() + +load("@org_pubref_rules_protobuf//go:rules.bzl", "go_proto_repositories") +go_proto_repositories() +load("@org_pubref_rules_protobuf//grpc_gateway:rules.bzl", + "grpc_gateway_proto_repositories") +grpc_gateway_proto_repositories() diff --git a/hub/commands/create_user.cc b/hub/commands/create_user.cc index 2b5bf01..30aca91 100644 --- a/hub/commands/create_user.cc +++ b/hub/commands/create_user.cc @@ -16,8 +16,9 @@ using namespace sqlpp; namespace iota { namespace cmd { -grpc::Status CreateUser::doProcess(const iota::rpc::CreateUserRequest* request, - iota::rpc::CreateUserReply* response) noexcept { +grpc::Status CreateUser::doProcess( + const iota::rpc::CreateUserRequest* request, + iota::rpc::CreateUserReply* response) noexcept { db::sql::UserAccount userAccount; auto& connection = db::DBManager::get().connection(); @@ -26,7 +27,7 @@ grpc::Status CreateUser::doProcess(const iota::rpc::CreateUserRequest* request, try { connection(insert_into(userAccount) - .set(userAccount.identifier = request->userid())); + .set(userAccount.identifier = request->userid())); transaction.commit(); } catch (sqlpp::exception& ex) { LOG(ERROR) << session() << " Commit failed: " << ex.what(); diff --git a/hub/commands/create_user.h b/hub/commands/create_user.h index 8badcbc..2e57765 100644 --- a/hub/commands/create_user.h +++ b/hub/commands/create_user.h @@ -17,8 +17,9 @@ class CreateUser using Command::Command; - grpc::Status doProcess(const iota::rpc::CreateUserRequest* request, - iota::rpc::CreateUserReply* response) noexcept override; + grpc::Status doProcess( + const iota::rpc::CreateUserRequest* request, + iota::rpc::CreateUserReply* response) noexcept override; const std::string name() override { return "CreateUser"; } }; diff --git a/hub/commands/get_balance.cc b/hub/commands/get_balance.cc index 7547ae7..0285e15 100644 --- a/hub/commands/get_balance.cc +++ b/hub/commands/get_balance.cc @@ -3,13 +3,13 @@ #include #include -#include #include +#include -#include "proto/hub.pb.h" -#include "schema/schema.h" #include "hub/db/db.h" #include "hub/stats/session.h" +#include "proto/hub.pb.h" +#include "schema/schema.h" #include "helper.h" diff --git a/hub/commands/get_balance.h b/hub/commands/get_balance.h index c6c3ad6..8428ab0 100644 --- a/hub/commands/get_balance.h +++ b/hub/commands/get_balance.h @@ -17,8 +17,9 @@ class GetBalance using Command::Command; - grpc::Status doProcess(const iota::rpc::GetBalanceRequest* request, - iota::rpc::GetBalanceReply* response) noexcept override; + grpc::Status doProcess( + const iota::rpc::GetBalanceRequest* request, + iota::rpc::GetBalanceReply* response) noexcept override; const std::string name() override { return "GetBalance"; } }; diff --git a/hub/commands/helper.cc b/hub/commands/helper.cc index e9ece06..17dedcf 100644 --- a/hub/commands/helper.cc +++ b/hub/commands/helper.cc @@ -6,14 +6,14 @@ namespace iota { namespace cmd { - std::string errorToString(const iota::rpc::ErrorCode& e) { - std::ostringstream ss; - iota::rpc::Error error; +std::string errorToString(const iota::rpc::ErrorCode& e) { + std::ostringstream ss; + iota::rpc::Error error; - error.set_code(e); - error.SerializeToOstream(&ss); - - return ss.str(); - } + error.set_code(e); + error.SerializeToOstream(&ss); + + return ss.str(); } +} // namespace cmd } // namespace iota diff --git a/hub/commands/tests/test_create_user.cc b/hub/commands/tests/test_create_user.cc index bcc5bfe..7295904 100644 --- a/hub/commands/tests/test_create_user.cc +++ b/hub/commands/tests/test_create_user.cc @@ -1,7 +1,7 @@ #include -#include #include +#include #include "proto/hub.pb.h" #include "schema/schema.h" diff --git a/hub/commands/tests/test_get_balance.cc b/hub/commands/tests/test_get_balance.cc index 4ddf864..d59bab6 100644 --- a/hub/commands/tests/test_get_balance.cc +++ b/hub/commands/tests/test_get_balance.cc @@ -1,13 +1,13 @@ #include -#include #include +#include #include "proto/hub.pb.h" #include "schema/schema.h" +#include "hub/commands/get_balance.h" #include "hub/db/db.h" #include "hub/stats/session.h" -#include "hub/commands/get_balance.h" #include "runner.h"