mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
[clang-tidy] Enable the misc-no-recursion check
Co-authored-by: stickies-v <stickies-v@protonmail.com> Co-authored-by: Gloria Zhao <gloriajzhao@gmail.com>
This commit is contained in:
@@ -414,6 +414,7 @@ struct Sections {
|
||||
/**
|
||||
* Recursive helper to translate an RPCArg into sections
|
||||
*/
|
||||
// NOLINTNEXTLINE(misc-no-recursion)
|
||||
void Push(const RPCArg& arg, const size_t current_indent = 5, const OuterType outer_type = OuterType::NONE)
|
||||
{
|
||||
const auto indent = std::string(current_indent, ' ');
|
||||
@@ -953,6 +954,7 @@ std::string RPCArg::ToDescriptionString(bool is_named_arg) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(misc-no-recursion)
|
||||
void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const int current_indent) const
|
||||
{
|
||||
// Indentation
|
||||
@@ -1086,6 +1088,7 @@ static std::optional<UniValue::VType> ExpectedType(RPCResult::Type type)
|
||||
NONFATAL_UNREACHABLE();
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(misc-no-recursion)
|
||||
UniValue RPCResult::MatchesType(const UniValue& result) const
|
||||
{
|
||||
if (m_skip_type_check) {
|
||||
@@ -1164,6 +1167,7 @@ void RPCResult::CheckInnerDoc() const
|
||||
CHECK_NONFATAL(inner_needed != m_inner.empty());
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(misc-no-recursion)
|
||||
std::string RPCArg::ToStringObj(const bool oneline) const
|
||||
{
|
||||
std::string res;
|
||||
@@ -1202,6 +1206,7 @@ std::string RPCArg::ToStringObj(const bool oneline) const
|
||||
NONFATAL_UNREACHABLE();
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(misc-no-recursion)
|
||||
std::string RPCArg::ToString(const bool oneline) const
|
||||
{
|
||||
if (oneline && !m_opts.oneline_description.empty()) {
|
||||
@@ -1228,6 +1233,7 @@ std::string RPCArg::ToString(const bool oneline) const
|
||||
case Type::OBJ:
|
||||
case Type::OBJ_NAMED_PARAMS:
|
||||
case Type::OBJ_USER_KEYS: {
|
||||
// NOLINTNEXTLINE(misc-no-recursion)
|
||||
const std::string res = Join(m_inner, ",", [&](const RPCArg& i) { return i.ToStringObj(oneline); });
|
||||
if (m_type == Type::OBJ) {
|
||||
return "{" + res + "}";
|
||||
|
||||
Reference in New Issue
Block a user