chore: Enable more clang-tidy checks (#3054)

This commit is contained in:
Alex Kremer
2026-05-01 15:31:45 +01:00
committed by GitHub
parent d6bae6c12b
commit 51244feb4a
239 changed files with 1150 additions and 733 deletions

View File

@@ -47,13 +47,13 @@ ClioConfigDefinition::getObject(std::string_view prefix, std::optional<std::size
for (auto const& [mapKey, mapVal] : map_) {
auto const hasPrefix = mapKey.starts_with(prefixWithDot);
if (idx.has_value() && hasPrefix && std::holds_alternative<Array>(mapVal)) {
ASSERT(std::get<Array>(mapVal).size() > idx.value(), "Index provided is out of scope");
ASSERT(std::get<Array>(mapVal).size() > *idx, "Index provided is out of scope");
// we want to support getObject("array") and getObject("array.[]"), so we check if "[]"
// exists
if (!prefix.contains("[]"))
return ObjectView{prefixWithDot + "[]", idx.value(), *this};
return ObjectView{prefix, idx.value(), *this};
return ObjectView{prefixWithDot + "[]", *idx, *this};
return ObjectView{prefix, *idx, *this};
}
if (hasPrefix && !idx.has_value() && !mapKey.contains(prefixWithDot + "[]"))
return ObjectView{prefix, *this};
@@ -174,7 +174,7 @@ ClioConfigDefinition::parse(ConfigFileInterface const& config)
[&key, &config, &listOfErrors](ConfigValue& val) {
if (auto const maybeError = val.setValue(config.getValue(key), key);
maybeError.has_value()) {
listOfErrors.emplace_back(maybeError.value());
listOfErrors.emplace_back(*maybeError);
}
},
// handle the case where the config value is an array.