mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-08 13:55:51 +00:00
style: clang-tidy auto fixes (#1786)
Fixes #1785. Please review and commit clang-tidy fixes. Co-authored-by: kuznetsss <15742918+kuznetsss@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3c4903a339
commit
15a441b084
@@ -24,8 +24,6 @@
|
||||
#include "util/Constants.hpp"
|
||||
#include "util/newconfig/ObjectView.hpp"
|
||||
|
||||
#include <boost/json/conversion.hpp>
|
||||
#include <boost/json/value.hpp>
|
||||
|
||||
#include <cerrno>
|
||||
#include <chrono>
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "etl/impl/SourceImpl.hpp"
|
||||
#include "etl/impl/SubscriptionSource.hpp"
|
||||
#include "feed/SubscriptionManagerInterface.hpp"
|
||||
#include "util/newconfig/ConfigDefinition.hpp"
|
||||
#include "util/newconfig/ObjectView.hpp"
|
||||
|
||||
#include <boost/asio/io_context.hpp>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "rpc/common/impl/APIVersionParser.hpp"
|
||||
|
||||
#include "util/log/Logger.hpp"
|
||||
#include "util/newconfig/ObjectView.hpp"
|
||||
|
||||
#include <boost/json/object.hpp>
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include <boost/date_time/posix_time/posix_time_duration.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/json/conversion.hpp>
|
||||
#include <boost/json/value.hpp>
|
||||
#include <boost/log/attributes/attribute_value_set.hpp>
|
||||
#include <boost/log/core/core.hpp>
|
||||
#include <boost/log/expressions/filter.hpp>
|
||||
@@ -91,7 +89,7 @@ operator<<(std::ostream& stream, Severity sev)
|
||||
* @param logLevel A string representing the log level
|
||||
* @return Severity The corresponding Severity enum value.
|
||||
*/
|
||||
Severity
|
||||
static Severity
|
||||
getSeverityLevel(std::string_view logLevel)
|
||||
{
|
||||
if (boost::iequals(logLevel, "trace"))
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "util/newconfig/ValueView.hpp"
|
||||
#include "web/dosguard/WhitelistHandlerInterface.hpp"
|
||||
|
||||
#include <boost/iterator/transform_iterator.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
|
||||
@@ -208,7 +208,7 @@ struct WithMockPrometheus : virtual ::testing::Test {
|
||||
}
|
||||
std::cerr << "\n";
|
||||
}
|
||||
config::ClioConfigDefinition config{
|
||||
config::ClioConfigDefinition const config{
|
||||
{"prometheus.compress_reply", config::ConfigValue{config::ConfigType::Boolean}.defaultValue(true)},
|
||||
{"prometheus.enabled", config::ConfigValue{config::ConfigType::Boolean}.defaultValue(true)}
|
||||
};
|
||||
@@ -259,7 +259,7 @@ struct WithMockPrometheus : virtual ::testing::Test {
|
||||
struct WithPrometheus : virtual ::testing::Test {
|
||||
WithPrometheus()
|
||||
{
|
||||
config::ClioConfigDefinition config{
|
||||
config::ClioConfigDefinition const config{
|
||||
{"prometheus.compress_reply", config::ConfigValue{config::ConfigType::Boolean}.defaultValue(false)},
|
||||
{"prometheus.enabled", config::ConfigValue{config::ConfigType::Boolean}.defaultValue(true)}
|
||||
};
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "util/newconfig/Types.hpp"
|
||||
|
||||
#include <TestGlobals.hpp>
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@@ -75,13 +74,13 @@ protected:
|
||||
|
||||
TEST_F(BackendCassandraFactoryTest, NoSuchBackend)
|
||||
{
|
||||
ClioConfigDefinition cfg{{"database.type", ConfigValue{ConfigType::String}.defaultValue("unknown")}};
|
||||
ClioConfigDefinition const cfg{{"database.type", ConfigValue{ConfigType::String}.defaultValue("unknown")}};
|
||||
EXPECT_THROW(data::make_Backend(cfg), std::runtime_error);
|
||||
}
|
||||
|
||||
TEST_F(BackendCassandraFactoryTest, CreateCassandraBackendDBDisconnect)
|
||||
{
|
||||
ClioConfigDefinition cfg{
|
||||
ClioConfigDefinition const cfg{
|
||||
{"database.type", ConfigValue{ConfigType::String}.defaultValue("cassandra")},
|
||||
{"database.cassandra.contact_points", ConfigValue{ConfigType::String}.defaultValue("127.0.0.2")},
|
||||
{"database.cassandra.keyspace", ConfigValue{ConfigType::String}.defaultValue(keyspace)},
|
||||
@@ -93,7 +92,7 @@ TEST_F(BackendCassandraFactoryTest, CreateCassandraBackendDBDisconnect)
|
||||
|
||||
TEST_F(BackendCassandraFactoryTestWithDB, CreateCassandraBackend)
|
||||
{
|
||||
ClioConfigDefinition cfg{
|
||||
ClioConfigDefinition const cfg{
|
||||
{"database.type", ConfigValue{ConfigType::String}.defaultValue("cassandra")},
|
||||
{"database.cassandra.contact_points",
|
||||
ConfigValue{ConfigType::String}.defaultValue(TestGlobals::instance().backendHost)},
|
||||
@@ -127,7 +126,7 @@ TEST_F(BackendCassandraFactoryTestWithDB, CreateCassandraBackend)
|
||||
|
||||
TEST_F(BackendCassandraFactoryTestWithDB, CreateCassandraBackendReadOnlyWithEmptyDB)
|
||||
{
|
||||
ClioConfigDefinition cfg{
|
||||
ClioConfigDefinition const cfg{
|
||||
{"read_only", ConfigValue{ConfigType::Boolean}.defaultValue(true)},
|
||||
{"database.type", ConfigValue{ConfigType::String}.defaultValue("cassandra")},
|
||||
{"database.cassandra.contact_points",
|
||||
@@ -141,7 +140,7 @@ TEST_F(BackendCassandraFactoryTestWithDB, CreateCassandraBackendReadOnlyWithEmpt
|
||||
|
||||
TEST_F(BackendCassandraFactoryTestWithDB, CreateCassandraBackendReadOnlyWithDBReady)
|
||||
{
|
||||
ClioConfigDefinition cfgReadOnly{
|
||||
ClioConfigDefinition const cfgReadOnly{
|
||||
{"read_only", ConfigValue{ConfigType::Boolean}.defaultValue(true)},
|
||||
{"database.type", ConfigValue{ConfigType::String}.defaultValue("cassandra")},
|
||||
{"database.cassandra.contact_points",
|
||||
@@ -150,7 +149,7 @@ TEST_F(BackendCassandraFactoryTestWithDB, CreateCassandraBackendReadOnlyWithDBRe
|
||||
{"database.cassandra.replication_factor", ConfigValue{ConfigType::Integer}.defaultValue(1)}
|
||||
};
|
||||
|
||||
ClioConfigDefinition cfgWrite{
|
||||
ClioConfigDefinition const cfgWrite{
|
||||
{"read_only", ConfigValue{ConfigType::Boolean}.defaultValue(false)},
|
||||
{"database.type", ConfigValue{ConfigType::String}.defaultValue("cassandra")},
|
||||
{"database.cassandra.contact_points",
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
#include <boost/asio/impl/spawn.hpp>
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/spawn.hpp>
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <xrpl/basics/Slice.h>
|
||||
#include <xrpl/basics/base_uint.h>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "util/Assert.hpp"
|
||||
#include "util/LoggerFixtures.hpp"
|
||||
#include "util/config/Config.hpp"
|
||||
#include "util/log/Logger.hpp"
|
||||
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/json/conversion.hpp>
|
||||
@@ -32,6 +31,7 @@
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <fstream>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace json = boost::json;
|
||||
|
||||
using namespace data::cassandra;
|
||||
|
||||
inline ClioConfigDefinition
|
||||
inline static ClioConfigDefinition
|
||||
getParseSettingsConfig(boost::json::value val)
|
||||
{
|
||||
ConfigFileJson const jsonVal{val.as_object()};
|
||||
|
||||
@@ -32,7 +32,7 @@ using namespace etl;
|
||||
using namespace testing;
|
||||
using namespace util::config;
|
||||
|
||||
inline ClioConfigDefinition
|
||||
inline static ClioConfigDefinition
|
||||
generateDefaultCacheConfig()
|
||||
{
|
||||
return ClioConfigDefinition{
|
||||
@@ -46,7 +46,7 @@ generateDefaultCacheConfig()
|
||||
};
|
||||
}
|
||||
|
||||
inline ClioConfigDefinition
|
||||
inline static ClioConfigDefinition
|
||||
getParseCacheConfig(boost::json::value val)
|
||||
{
|
||||
ConfigFileJson const jsonVal{val.as_object()};
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "etl/CacheLoaderSettings.hpp"
|
||||
#include "etl/FakeDiffProvider.hpp"
|
||||
#include "etl/impl/CacheLoader.hpp"
|
||||
#include "util/Assert.hpp"
|
||||
#include "util/MockBackendTestFixture.hpp"
|
||||
#include "util/MockCache.hpp"
|
||||
#include "util/MockPrometheus.hpp"
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "util/TestObject.hpp"
|
||||
#include "util/newconfig/ConfigDefinition.hpp"
|
||||
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@@ -95,7 +95,7 @@ constexpr static auto const ThreeSourcesLedgerResponse = R"({
|
||||
]
|
||||
})";
|
||||
|
||||
inline ClioConfigDefinition
|
||||
inline static ClioConfigDefinition
|
||||
getParseLoadBalancerConfig(boost::json::value val)
|
||||
{
|
||||
ClioConfigDefinition config{
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "util/newconfig/Types.hpp"
|
||||
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
constexpr static auto DEFAULT_API_VERSION = 5u;
|
||||
@@ -96,7 +95,7 @@ TEST_F(RPCAPIVersionTest, ReturnsParsedVersionIfAllPreconditionsAreMet)
|
||||
|
||||
TEST_F(RPCAPIVersionTest, GetsValuesFromConfigCorrectly)
|
||||
{
|
||||
ClioConfigDefinition cfg{
|
||||
ClioConfigDefinition const cfg{
|
||||
{"api_version.min", ConfigValue{ConfigType::Integer}.defaultValue(MIN_API_VERSION)},
|
||||
{"api_version.max", ConfigValue{ConfigType::Integer}.defaultValue(MAX_API_VERSION)},
|
||||
{"api_version.default", ConfigValue{ConfigType::Integer}.defaultValue(DEFAULT_API_VERSION)}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include "data/BackendInterface.hpp"
|
||||
#include "data/Types.hpp"
|
||||
#include "rpc/Errors.hpp"
|
||||
#include "rpc/FakesAndMocks.hpp"
|
||||
#include "rpc/RPCEngine.hpp"
|
||||
@@ -39,6 +40,7 @@
|
||||
#include "util/newconfig/ConfigFileJson.hpp"
|
||||
#include "util/newconfig/ConfigValue.hpp"
|
||||
#include "util/newconfig/Types.hpp"
|
||||
#include "web/Context.hpp"
|
||||
#include "web/dosguard/DOSGuard.hpp"
|
||||
#include "web/dosguard/WhitelistHandler.hpp"
|
||||
|
||||
@@ -70,7 +72,7 @@ constexpr auto FORWARD_REPLY = R"JSON({
|
||||
})JSON";
|
||||
} // namespace
|
||||
|
||||
inline ClioConfigDefinition
|
||||
inline static ClioConfigDefinition
|
||||
generateDefaultRPCEngineConfig()
|
||||
{
|
||||
return ClioConfigDefinition{
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "util/prometheus/Counter.hpp"
|
||||
#include "util/prometheus/Gauge.hpp"
|
||||
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "util/newconfig/ConfigValue.hpp"
|
||||
#include "util/newconfig/Types.hpp"
|
||||
|
||||
#include <boost/json/value.hpp>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "util/newconfig/ConfigFileJson.hpp"
|
||||
#include "util/newconfig/FakeConfigData.hpp"
|
||||
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
#include <boost/beast/http/status.hpp>
|
||||
#include <boost/beast/http/string_body.hpp>
|
||||
#include <boost/beast/http/verb.hpp>
|
||||
#include <boost/json/object.hpp>
|
||||
#include <boost/json/value.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@@ -54,7 +52,7 @@ struct PrometheusCheckRequestTests : public ::testing::TestWithParam<PrometheusC
|
||||
|
||||
TEST_P(PrometheusCheckRequestTests, isPrometheusRequest)
|
||||
{
|
||||
ClioConfigDefinition config{
|
||||
ClioConfigDefinition const config{
|
||||
{"prometheus.enabled", ConfigValue{ConfigType::Boolean}.defaultValue(GetParam().prometheusEnabled)},
|
||||
{"prometheus.compress_reply", ConfigValue{ConfigType::Boolean}.defaultValue(true)}
|
||||
};
|
||||
@@ -128,7 +126,7 @@ TEST_F(PrometheusHandleRequestTests, emptyResponse)
|
||||
|
||||
TEST_F(PrometheusHandleRequestTests, prometheusDisabled)
|
||||
{
|
||||
ClioConfigDefinition config{
|
||||
ClioConfigDefinition const config{
|
||||
{"prometheus.enabled", ConfigValue{ConfigType::Boolean}.defaultValue(false)},
|
||||
{"prometheus.compress_reply", ConfigValue{ConfigType::Boolean}.defaultValue(true)}
|
||||
};
|
||||
|
||||
@@ -32,9 +32,7 @@
|
||||
#include <boost/json/value.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
||||
namespace http = boost::beast::http;
|
||||
@@ -141,7 +139,7 @@ struct MakeAdminVerificationStrategyFromConfigTestParams {
|
||||
struct MakeAdminVerificationStrategyFromConfigTest
|
||||
: public testing::TestWithParam<MakeAdminVerificationStrategyFromConfigTestParams> {};
|
||||
|
||||
inline ClioConfigDefinition
|
||||
inline static ClioConfigDefinition
|
||||
generateDefaultAdminConfig()
|
||||
{
|
||||
return ClioConfigDefinition{
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "util/newconfig/ConfigFileJson.hpp"
|
||||
#include "util/newconfig/ConfigValue.hpp"
|
||||
#include "util/newconfig/Types.hpp"
|
||||
#include "util/prometheus/Gauge.hpp"
|
||||
#include "util/prometheus/Label.hpp"
|
||||
#include "util/prometheus/Prometheus.hpp"
|
||||
#include "web/AdminVerificationStrategy.hpp"
|
||||
@@ -111,7 +110,7 @@ generateJSONDataOverload(std::string_view port)
|
||||
));
|
||||
}
|
||||
|
||||
inline ClioConfigDefinition
|
||||
inline static ClioConfigDefinition
|
||||
getParseServerConfig(boost::json::value val)
|
||||
{
|
||||
ConfigFileJson const jsonVal{val.as_object()};
|
||||
@@ -534,7 +533,7 @@ struct WebServerAdminTestParams {
|
||||
std::string expectedResponse;
|
||||
};
|
||||
|
||||
inline ClioConfigDefinition
|
||||
inline static ClioConfigDefinition
|
||||
getParseAdminServerConfig(boost::json::value val)
|
||||
{
|
||||
ConfigFileJson const jsonVal{val.as_object()};
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "util/LoggerFixtures.hpp"
|
||||
#include "util/Taggable.hpp"
|
||||
#include "util/config/Config.hpp"
|
||||
#include "util/newconfig/ConfigDefinition.hpp"
|
||||
#include "util/newconfig/ConfigValue.hpp"
|
||||
#include "util/newconfig/Types.hpp"
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "web/dosguard/DOSGuard.hpp"
|
||||
#include "web/dosguard/WhitelistHandlerInterface.hpp"
|
||||
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "web/dosguard/DOSGuardMock.hpp"
|
||||
#include "web/dosguard/IntervalSweepHandler.hpp"
|
||||
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ using namespace web::dosguard;
|
||||
|
||||
struct WhitelistHandlerTest : NoLoggerFixture {};
|
||||
|
||||
inline ClioConfigDefinition
|
||||
inline static ClioConfigDefinition
|
||||
getParseWhitelistHandlerConfig(boost::json::value val)
|
||||
{
|
||||
ConfigFileJson const jsonVal{val.as_object()};
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "util/MockPrometheus.hpp"
|
||||
#include "util/MockRPCEngine.hpp"
|
||||
#include "util/Taggable.hpp"
|
||||
#include "util/config/Config.hpp"
|
||||
#include "util/newconfig/ConfigDefinition.hpp"
|
||||
#include "util/newconfig/ConfigValue.hpp"
|
||||
#include "util/newconfig/Types.hpp"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "util/Taggable.hpp"
|
||||
#include "util/build/Build.hpp"
|
||||
#include "util/config/Config.hpp"
|
||||
#include "util/newconfig/ConfigDefinition.hpp"
|
||||
#include "util/newconfig/ConfigValue.hpp"
|
||||
#include "util/newconfig/Types.hpp"
|
||||
@@ -137,7 +136,7 @@ TEST_F(ResponseTest, asConstBufferJson)
|
||||
|
||||
TEST_F(ResponseTest, createFromStringAndConnection)
|
||||
{
|
||||
util::TagDecoratorFactory tagDecoratorFactory{
|
||||
util::TagDecoratorFactory const tagDecoratorFactory{
|
||||
ClioConfigDefinition{{"log_tag_style", ConfigValue{ConfigType::String}.defaultValue("uint")}}
|
||||
};
|
||||
StrictMockConnection const connection{"some ip", boost::beast::flat_buffer{}, tagDecoratorFactory};
|
||||
@@ -156,7 +155,7 @@ TEST_F(ResponseTest, createFromStringAndConnection)
|
||||
|
||||
TEST_F(ResponseTest, createFromJsonAndConnection)
|
||||
{
|
||||
util::TagDecoratorFactory tagDecoratorFactory{
|
||||
util::TagDecoratorFactory const tagDecoratorFactory{
|
||||
ClioConfigDefinition{{"log_tag_style", ConfigValue{ConfigType::String}.defaultValue("uint")}}
|
||||
};
|
||||
StrictMockConnection const connection{"some ip", boost::beast::flat_buffer{}, tagDecoratorFactory};
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include <boost/beast/http/string_body.hpp>
|
||||
#include <boost/beast/http/verb.hpp>
|
||||
#include <boost/beast/websocket/error.hpp>
|
||||
#include <boost/json/object.hpp>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include <boost/beast/http/status.hpp>
|
||||
#include <boost/beast/http/string_body.hpp>
|
||||
#include <boost/beast/http/verb.hpp>
|
||||
#include <boost/json/object.hpp>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ struct MakeServerSslContextFromConfigTest : testing::TestWithParam<MakeServerSsl
|
||||
|
||||
TEST_P(MakeServerSslContextFromConfigTest, makeFromConfig)
|
||||
{
|
||||
ConfigFileJson js{GetParam().configJson().as_object()};
|
||||
ConfigFileJson const js{GetParam().configJson().as_object()};
|
||||
// generate cert and key file
|
||||
auto config = ClioConfigDefinition{
|
||||
{"ssl_key_file", ConfigValue{ConfigType::String}.optional()},
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "util/TestWebSocketClient.hpp"
|
||||
#include "util/newconfig/ConfigDefinition.hpp"
|
||||
#include "util/newconfig/ConfigValue.hpp"
|
||||
#include "util/newconfig/Error.hpp"
|
||||
#include "util/newconfig/Types.hpp"
|
||||
#include "web/ng/Error.hpp"
|
||||
#include "web/ng/Request.hpp"
|
||||
@@ -36,7 +35,6 @@
|
||||
#include <boost/asio/ssl/context.hpp>
|
||||
#include <boost/beast/core/flat_buffer.hpp>
|
||||
#include <boost/beast/http/status.hpp>
|
||||
#include <boost/json/object.hpp>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user