Skip to content

Commit

Permalink
style: clang-tidy auto fixes (#1786)
Browse files Browse the repository at this point in the history
Fixes #1785. Please review and commit clang-tidy fixes.

Co-authored-by: kuznetsss <[email protected]>
  • Loading branch information
github-actions[bot] and kuznetsss authored Dec 17, 2024
1 parent 3c4903a commit 15a441b
Show file tree
Hide file tree
Showing 32 changed files with 28 additions and 54 deletions.
2 changes: 0 additions & 2 deletions src/data/cassandra/SettingsProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 0 additions & 1 deletion src/etl/Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions src/rpc/common/impl/APIVersionParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 1 addition & 3 deletions src/util/log/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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"))
Expand Down
1 change: 0 additions & 1 deletion src/web/dosguard/DOSGuard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "util/newconfig/ValueView.hpp"
#include "web/dosguard/WhitelistHandlerInterface.hpp"

#include <boost/iterator/transform_iterator.hpp>

#include <cstdint>
#include <functional>
Expand Down
4 changes: 2 additions & 2 deletions tests/common/util/MockPrometheus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
};
Expand Down Expand Up @@ -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)}
};
Expand Down
13 changes: 6 additions & 7 deletions tests/integration/data/BackendFactoryTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -75,13 +74,13 @@ class BackendCassandraFactoryTestWithDB : public BackendCassandraFactoryTest {

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)},
Expand All @@ -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)},
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/data/cassandra/BackendTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ConfigTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -32,6 +31,7 @@
#include <cstdint>
#include <cstdio>
#include <fstream>
#include <optional>
#include <stdexcept>
#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/cassandra/SettingsProviderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()};
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/etl/CacheLoaderSettingsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace etl;
using namespace testing;
using namespace util::config;

inline ClioConfigDefinition
inline static ClioConfigDefinition
generateDefaultCacheConfig()
{
return ClioConfigDefinition{
Expand All @@ -46,7 +46,7 @@ generateDefaultCacheConfig()
};
}

inline ClioConfigDefinition
inline static ClioConfigDefinition
getParseCacheConfig(boost::json::value val)
{
ConfigFileJson const jsonVal{val.as_object()};
Expand Down
1 change: 0 additions & 1 deletion tests/unit/etl/CacheLoaderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion tests/unit/etl/LedgerPublisherTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/etl/LoadBalancerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ constexpr static auto const ThreeSourcesLedgerResponse = R"({
]
})";

inline ClioConfigDefinition
inline static ClioConfigDefinition
getParseLoadBalancerConfig(boost::json::value val)
{
ClioConfigDefinition config{
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/rpc/APIVersionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)}
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/rpc/RPCEngineTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
//==============================================================================

#include "data/BackendInterface.hpp"
#include "data/Types.hpp"
#include "rpc/Errors.hpp"
#include "rpc/FakesAndMocks.hpp"
#include "rpc/RPCEngine.hpp"
Expand All @@ -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"

Expand Down Expand Up @@ -70,7 +72,7 @@ constexpr auto FORWARD_REPLY = R"JSON({
})JSON";
} // namespace

inline ClioConfigDefinition
inline static ClioConfigDefinition
generateDefaultRPCEngineConfig()
{
return ClioConfigDefinition{
Expand Down
1 change: 0 additions & 1 deletion tests/unit/rpc/WorkQueueTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
1 change: 0 additions & 1 deletion tests/unit/util/SignalsHandlerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
1 change: 0 additions & 1 deletion tests/unit/util/newconfig/JsonFileTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/util/prometheus/HttpTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -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)}
};
Expand Down Expand Up @@ -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)}
};
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/web/AdminVerificationTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -141,7 +139,7 @@ struct MakeAdminVerificationStrategyFromConfigTestParams {
struct MakeAdminVerificationStrategyFromConfigTest
: public testing::TestWithParam<MakeAdminVerificationStrategyFromConfigTestParams> {};

inline ClioConfigDefinition
inline static ClioConfigDefinition
generateDefaultAdminConfig()
{
return ClioConfigDefinition{
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/web/ServerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()};
Expand Down Expand Up @@ -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()};
Expand Down
1 change: 0 additions & 1 deletion tests/unit/web/SubscriptionContextTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion tests/unit/web/dosguard/DOSGuardTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
1 change: 0 additions & 1 deletion tests/unit/web/dosguard/IntervalSweepHandlerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/web/dosguard/WhitelistHandlerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()};
Expand Down
1 change: 0 additions & 1 deletion tests/unit/web/ng/RPCServerHandlerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 15a441b

Please sign in to comment.