chore: Enable clang-tidy modernize checks (#6975)

Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
This commit is contained in:
Alex Kremer
2026-04-21 16:32:51 +01:00
committed by GitHub
parent ab887f5049
commit ce3951bbb3
699 changed files with 4626 additions and 5292 deletions

View File

@@ -265,9 +265,7 @@ public:
return absolute(file()).string();
}
~ValidatorsTxtGuard()
{
}
~ValidatorsTxtGuard() = default;
};
} // namespace detail
@@ -1278,20 +1276,41 @@ r.ripple.com:51235
};
std::array<TestCommentData, 13> const tests = {
{{"password = aaaa\\#bbbb", "password", "aaaa#bbbb", false},
{"password = aaaa#bbbb", "password", "aaaa", true},
{"password = aaaa #bbbb", "password", "aaaa", true},
{{.line = "password = aaaa\\#bbbb",
.field = "password",
.expect = "aaaa#bbbb",
.had_comment = false},
{.line = "password = aaaa#bbbb",
.field = "password",
.expect = "aaaa",
.had_comment = true},
{.line = "password = aaaa #bbbb",
.field = "password",
.expect = "aaaa",
.had_comment = true},
// since the value is all comment, this doesn't parse as k=v :
{"password = #aaaa #bbbb", "", "password =", true},
{"password = aaaa\\# #bbbb", "password", "aaaa#", true},
{"password = aaaa\\##bbbb", "password", "aaaa#", true},
{"aaaa#bbbb", "", "aaaa", true},
{"aaaa\\#bbbb", "", "aaaa#bbbb", false},
{"aaaa\\##bbbb", "", "aaaa#", true},
{"aaaa #bbbb", "", "aaaa", true},
{"1 #comment", "", "1", true},
{"#whole thing is comment", "", "", false},
{" #whole comment with space", "", "", false}}};
{.line = "password = #aaaa #bbbb",
.field = "",
.expect = "password =",
.had_comment = true},
{.line = "password = aaaa\\# #bbbb",
.field = "password",
.expect = "aaaa#",
.had_comment = true},
{.line = "password = aaaa\\##bbbb",
.field = "password",
.expect = "aaaa#",
.had_comment = true},
{.line = "aaaa#bbbb", .field = "", .expect = "aaaa", .had_comment = true},
{.line = "aaaa\\#bbbb", .field = "", .expect = "aaaa#bbbb", .had_comment = false},
{.line = "aaaa\\##bbbb", .field = "", .expect = "aaaa#", .had_comment = true},
{.line = "aaaa #bbbb", .field = "", .expect = "aaaa", .had_comment = true},
{.line = "1 #comment", .field = "", .expect = "1", .had_comment = true},
{.line = "#whole thing is comment", .field = "", .expect = "", .had_comment = false},
{.line = " #whole comment with space",
.field = "",
.expect = "",
.had_comment = false}}};
for (auto const& t : tests)
{