Skip to content

Commit

Permalink
Merge branch 'develop' into chore/no-all-caps
Browse files Browse the repository at this point in the history
  • Loading branch information
godexsoft committed Dec 26, 2024
2 parents 5a768b9 + efe5d08 commit 4c94d26
Show file tree
Hide file tree
Showing 269 changed files with 10,570 additions and 3,695 deletions.
11 changes: 10 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Checks: '-*,
bugprone-chained-comparison,
bugprone-compare-pointer-to-member-virtual-function,
bugprone-copy-constructor-init,
bugprone-crtp-constructor-accessibility,
bugprone-dangling-handle,
bugprone-dynamic-static-initializers,
bugprone-empty-catch,
Expand All @@ -33,9 +34,11 @@ Checks: '-*,
bugprone-non-zero-enum-to-bool-conversion,
bugprone-optional-value-conversion,
bugprone-parent-virtual-call,
bugprone-pointer-arithmetic-on-polymorphic-object,
bugprone-posix-return,
bugprone-redundant-branch-condition,
bugprone-reserved-identifier,
bugprone-return-const-ref-from-parameter,
bugprone-shared-ptr-array-mismatch,
bugprone-signal-handler,
bugprone-signed-char-misuse,
Expand All @@ -55,6 +58,7 @@ Checks: '-*,
bugprone-suspicious-realloc-usage,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-suspicious-stringview-data-usage,
bugprone-swapped-arguments,
bugprone-switch-missing-default-case,
bugprone-terminating-continue,
Expand Down Expand Up @@ -97,10 +101,12 @@ Checks: '-*,
modernize-make-unique,
modernize-pass-by-value,
modernize-type-traits,
modernize-use-designated-initializers,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-override,
modernize-use-ranges,
modernize-use-starts-ends-with,
modernize-use-std-numbers,
modernize-use-using,
Expand All @@ -121,10 +127,12 @@ Checks: '-*,
readability-convert-member-functions-to-static,
readability-duplicate-include,
readability-else-after-return,
readability-enum-initial-value,
readability-implicit-bool-conversion,
readability-inconsistent-declaration-parameter-name,
readability-identifier-naming,
readability-make-member-function-const,
readability-math-missing-parentheses,
readability-misleading-indentation,
readability-non-const-parameter,
readability-redundant-casting,
Expand All @@ -136,7 +144,8 @@ Checks: '-*,
readability-simplify-boolean-expr,
readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-suspicious-call-argument
readability-suspicious-call-argument,
readability-use-std-min-max
'

CheckOptions:
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/util/async/ExecutionContextBenchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ benchmarkThreads(benchmark::State& state)
}

template <typename CtxType>
void
static void
benchmarkExecutionContextBatched(benchmark::State& state)
{
auto data = generateData();
Expand All @@ -219,7 +219,7 @@ benchmarkExecutionContextBatched(benchmark::State& state)
}

template <typename CtxType>
void
static void
benchmarkAnyExecutionContextBatched(benchmark::State& state)
{
auto data = generateData();
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Clio(ConanFile):
'protobuf/3.21.9',
'grpc/1.50.1',
'openssl/1.1.1u',
'xrpl/2.3.0',
'xrpl/2.4.0-b1',
'zlib/1.3.1',
'libbacktrace/cci.20210118'
]
Expand Down
43 changes: 0 additions & 43 deletions docs/examples/config/cloud-example-config.json

This file was deleted.

1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ add_subdirectory(etlng)
add_subdirectory(feed)
add_subdirectory(rpc)
add_subdirectory(web)
add_subdirectory(migration)
add_subdirectory(app)
add_subdirectory(main)
4 changes: 2 additions & 2 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_library(clio_app)
target_sources(clio_app PRIVATE CliArgs.cpp ClioApplication.cpp)
target_sources(clio_app PRIVATE CliArgs.cpp ClioApplication.cpp WebHandlers.cpp)

target_link_libraries(clio_app PUBLIC clio_etl clio_etlng clio_feed clio_web clio_rpc)
target_link_libraries(clio_app PUBLIC clio_etl clio_etlng clio_feed clio_web clio_rpc clio_migration)
10 changes: 10 additions & 0 deletions src/app/CliArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "app/CliArgs.hpp"

#include "migration/MigrationApplication.hpp"
#include "util/build/Build.hpp"

#include <boost/program_options/options_description.hpp>
Expand All @@ -45,6 +46,7 @@ CliArgs::parse(int argc, char const* argv[])
("version,v", "print version and exit")
("conf,c", po::value<std::string>()->default_value(kDEFAULT_CONFIG_PATH), "configuration file")
("ng-web-server,w", "Use ng-web-server")
("migrate", po::value<std::string>(), "start migration helper")
;
// clang-format on
po::positional_options_description positional;
Expand All @@ -65,6 +67,14 @@ CliArgs::parse(int argc, char const* argv[])
}

auto configPath = parsed["conf"].as<std::string>();

if (parsed.count("migrate") != 0u) {
auto const opt = parsed["migrate"].as<std::string>();
if (opt == "status")
return Action{Action::Migrate{.configPath = std::move(configPath), .subCmd = MigrateSubCmd::status()}};
return Action{Action::Migrate{.configPath = std::move(configPath), .subCmd = MigrateSubCmd::migration(opt)}};
}

return Action{Action::Run{.configPath = std::move(configPath), .useNgWebServer = parsed.count("ng-web-server") != 0}
};
}
Expand Down
12 changes: 10 additions & 2 deletions src/app/CliArgs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#pragma once

#include "migration/MigrationApplication.hpp"
#include "util/OverloadSet.hpp"

#include <string>
Expand Down Expand Up @@ -52,13 +53,20 @@ class CliArgs {
int exitCode; ///< Exit code.
};

/** @brief Migration action. */
struct Migrate {
std::string configPath;
MigrateSubCmd subCmd;
};

/**
* @brief Construct an action from a Run.
*
* @param action Run action.
*/
template <typename ActionType>
requires std::is_same_v<ActionType, Run> or std::is_same_v<ActionType, Exit>
requires std::is_same_v<ActionType, Run> or std::is_same_v<ActionType, Exit> or
std::is_same_v<ActionType, Migrate>
explicit Action(ActionType&& action) : action_(std::forward<ActionType>(action))
{
}
Expand All @@ -78,7 +86,7 @@ class CliArgs {
}

private:
std::variant<Run, Exit> action_;
std::variant<Run, Exit, Migrate> action_;
};

/**
Expand Down
Loading

0 comments on commit 4c94d26

Please sign in to comment.