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:
Alex Kremer
2026-03-18 16:41:49 +00:00
committed by GitHub
parent b92a9a3053
commit 57e4cbbcd9
328 changed files with 4415 additions and 1176 deletions

View File

@@ -835,9 +835,13 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite
for (auto const& [n, score] : *scoreTable)
{
if (n == myId)
{
BEAST_EXPECT(score == 256);
}
else
{
BEAST_EXPECT(score == 0);
}
}
}
@@ -1306,11 +1310,17 @@ class NegativeUNLVoteScoreTable_test : public beast::unit_test::suite
[&](std::shared_ptr<Ledger const> const& l, std::size_t idx) -> bool {
std::size_t k = 0;
if (idx < 2)
{
k = 0;
}
else if (idx < 4)
{
k = 1;
}
else
{
k = 2;
}
bool add_50 = scorePattern[sp][k] == 50 && l->seq() % 2 == 0;
bool add_100 = scorePattern[sp][k] == 100;
@@ -1333,9 +1343,11 @@ class NegativeUNLVoteScoreTable_test : public beast::unit_test::suite
if (scorePattern[sp][k] == 50)
return score == 256 / 2;
if (scorePattern[sp][k] == 100)
{
return score == 256;
else
return false;
}
return false;
};
for (; i < 2; ++i)
{
@@ -1753,9 +1765,11 @@ applyAndTestResult(jtx::Env& env, OpenView& view, STTx const& tx, bool pass)
{
auto const res = apply(env.app(), view, tx, ApplyFlags::tapNONE, env.journal);
if (pass)
{
return isTesSuccess(res.ter);
else
return res.ter == tefFAILURE || res.ter == temDISABLED;
}
return res.ter == tefFAILURE || res.ter == temDISABLED;
}
bool
@@ -1791,7 +1805,7 @@ VerifyPubKeyAndSeq(
return false;
nUnlLedgerSeq.erase(it);
}
return nUnlLedgerSeq.size() == 0;
return nUnlLedgerSeq.empty();
}
std::size_t