mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-01 09:18:04 +00:00
refactor: Add simple clang-tidy readability checks (#6556)
This change enables the following clang-tidy checks: - readability-avoid-nested-conditional-operator, - readability-avoid-return-with-void-value, - readability-braces-around-statements, - readability-const-return-type, - readability-container-contains, - readability-container-size-empty, - readability-else-after-return, - readability-make-member-function-const, - readability-redundant-casting, - readability-redundant-inline-specifier, - readability-redundant-member-init, - readability-redundant-string-init, - readability-reference-to-constructed-temporary, - readability-static-definition
This commit is contained in:
@@ -23,11 +23,15 @@ public:
|
||||
enum TestAccount { None, Alice, Bogie };
|
||||
auto accountId = [&](AMM const& ammAlice, TestAccount v) -> std::optional<AccountID> {
|
||||
if (v == Alice)
|
||||
{
|
||||
return ammAlice.ammAccount();
|
||||
else if (v == Bogie)
|
||||
}
|
||||
if (v == Bogie)
|
||||
{
|
||||
return bogie;
|
||||
else
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
};
|
||||
|
||||
// Invalid tokens pair
|
||||
@@ -185,9 +189,13 @@ public:
|
||||
Account a(std::to_string(i));
|
||||
votes.insert({a.human(), 50 * (i + 1)});
|
||||
if (!features[fixAMMv1_3])
|
||||
{
|
||||
fund(env, gw, {a}, {USD(10000)}, Fund::Acct);
|
||||
}
|
||||
else
|
||||
{
|
||||
fund(env, gw, {a}, {USD(10001)}, Fund::Acct);
|
||||
}
|
||||
ammAlice.deposit(a, 10000000);
|
||||
ammAlice.vote(a, 50 * (i + 1));
|
||||
}
|
||||
@@ -197,6 +205,7 @@ public:
|
||||
env.fund(XRP(1000), bob, ed, bill);
|
||||
env(ammAlice.bid({.bidMin = 100, .authAccounts = {carol, bob, ed, bill}}));
|
||||
if (!features[fixAMMv1_3])
|
||||
{
|
||||
BEAST_EXPECT(ammAlice.expectAmmRpcInfo(
|
||||
XRP(80000),
|
||||
USD(80000),
|
||||
@@ -204,7 +213,9 @@ public:
|
||||
std::nullopt,
|
||||
std::nullopt,
|
||||
ammAlice.ammAccount()));
|
||||
}
|
||||
else
|
||||
{
|
||||
BEAST_EXPECT(ammAlice.expectAmmRpcInfo(
|
||||
XRPAmount(80000000005),
|
||||
STAmount{USD, UINT64_C(80'000'00000000005), -11},
|
||||
@@ -212,6 +223,7 @@ public:
|
||||
std::nullopt,
|
||||
std::nullopt,
|
||||
ammAlice.ammAccount()));
|
||||
}
|
||||
for (auto i = 0; i < 2; ++i)
|
||||
{
|
||||
std::unordered_set<std::string> authAccounts = {
|
||||
|
||||
Reference in New Issue
Block a user