clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: Ic2bc1d98d8ad469a3477f9059ec890fc8339907d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/utils/conversion.hpp b/src/utils/conversion.hpp
index e92249a..ea37c4f 100644
--- a/src/utils/conversion.hpp
+++ b/src/utils/conversion.hpp
@@ -57,8 +57,8 @@
}
template <class T, size_t N>
-constexpr inline T
- minEnumValue(std::array<std::pair<std::string_view, T>, N> data)
+constexpr inline T minEnumValue(
+ std::array<std::pair<std::string_view, T>, N> data)
{
auto min = data[0].second;
for (auto [key, value] : data)
@@ -72,8 +72,8 @@
}
template <class T, size_t N>
-constexpr inline T
- maxEnumValue(std::array<std::pair<std::string_view, T>, N> data)
+constexpr inline T maxEnumValue(
+ std::array<std::pair<std::string_view, T>, N> data)
{
auto max = data[0].second;
for (auto [key, value] : data)
@@ -101,9 +101,8 @@
}
template <class T, size_t N>
-inline std::string_view
- enumToString(const std::array<std::pair<std::string_view, T>, N>& data,
- T value)
+inline std::string_view enumToString(
+ const std::array<std::pair<std::string_view, T>, N>& data, T value)
{
auto it = std::find_if(
std::begin(data), std::end(data),
diff --git a/src/utils/conversion_trigger.cpp b/src/utils/conversion_trigger.cpp
index d577f76..29545db 100644
--- a/src/utils/conversion_trigger.cpp
+++ b/src/utils/conversion_trigger.cpp
@@ -21,11 +21,11 @@
const std::vector<numeric::ThresholdParam>& arg) const
{
return utils::transform(arg, [](const auto& thresholdParam) {
- const auto& [type, dwellTime, direction,
- thresholdValue] = thresholdParam;
- return numeric::LabeledThresholdParam(numeric::toType(type), dwellTime,
- numeric::toDirection(direction),
- thresholdValue);
+ const auto& [type, dwellTime, direction, thresholdValue] =
+ thresholdParam;
+ return numeric::LabeledThresholdParam(
+ numeric::toType(type), dwellTime, numeric::toDirection(direction),
+ thresholdValue);
});
}
@@ -33,8 +33,8 @@
const std::vector<discrete::ThresholdParam>& arg) const
{
return utils::transform(arg, [](const auto& thresholdParam) {
- const auto& [userId, severity, dwellTime,
- thresholdValue] = thresholdParam;
+ const auto& [userId, severity, dwellTime, thresholdValue] =
+ thresholdParam;
return discrete::LabeledThresholdParam(
userId, utils::toSeverity(severity), dwellTime, thresholdValue);
});
@@ -45,13 +45,14 @@
{
return utils::transform(
arg, [](const numeric::LabeledThresholdParam& labeledThresholdParam) {
- return numeric::ThresholdParam(
- numeric::typeToString(labeledThresholdParam.at_label<ts::Type>()),
- labeledThresholdParam.at_label<ts::DwellTime>(),
- numeric::directionToString(
- labeledThresholdParam.at_label<ts::Direction>()),
- labeledThresholdParam.at_label<ts::ThresholdValue>());
- });
+ return numeric::ThresholdParam(
+ numeric::typeToString(
+ labeledThresholdParam.at_label<ts::Type>()),
+ labeledThresholdParam.at_label<ts::DwellTime>(),
+ numeric::directionToString(
+ labeledThresholdParam.at_label<ts::Direction>()),
+ labeledThresholdParam.at_label<ts::ThresholdValue>());
+ });
}
TriggerThresholdParams FromLabeledThresholdParamConversion::operator()(
@@ -59,12 +60,13 @@
{
return utils::transform(
arg, [](const discrete::LabeledThresholdParam& labeledThresholdParam) {
- return discrete::ThresholdParam(
- labeledThresholdParam.at_label<ts::UserId>(),
- utils::enumToString(labeledThresholdParam.at_label<ts::Severity>()),
- labeledThresholdParam.at_label<ts::DwellTime>(),
- labeledThresholdParam.at_label<ts::ThresholdValue>());
- });
+ return discrete::ThresholdParam(
+ labeledThresholdParam.at_label<ts::UserId>(),
+ utils::enumToString(
+ labeledThresholdParam.at_label<ts::Severity>()),
+ labeledThresholdParam.at_label<ts::DwellTime>(),
+ labeledThresholdParam.at_label<ts::ThresholdValue>());
+ });
}
SensorsInfo fromLabeledSensorsInfo(const std::vector<LabeledSensorInfo>& infos)
@@ -76,8 +78,8 @@
});
}
-TriggerThresholdParams
- fromLabeledThresholdParam(const std::vector<LabeledThresholdParam>& params)
+TriggerThresholdParams fromLabeledThresholdParam(
+ const std::vector<LabeledThresholdParam>& params)
{
namespace ts = utils::tstring;
if (params.empty())
diff --git a/src/utils/conversion_trigger.hpp b/src/utils/conversion_trigger.hpp
index 10b0c03..7c76a01 100644
--- a/src/utils/conversion_trigger.hpp
+++ b/src/utils/conversion_trigger.hpp
@@ -10,10 +10,10 @@
{
public:
LabeledTriggerThresholdParams operator()(const std::monostate& arg) const;
- LabeledTriggerThresholdParams
- operator()(const std::vector<numeric::ThresholdParam>& arg) const;
- LabeledTriggerThresholdParams
- operator()(const std::vector<discrete::ThresholdParam>& arg) const;
+ LabeledTriggerThresholdParams operator()(
+ const std::vector<numeric::ThresholdParam>& arg) const;
+ LabeledTriggerThresholdParams operator()(
+ const std::vector<discrete::ThresholdParam>& arg) const;
};
class FromLabeledThresholdParamConversion
@@ -27,8 +27,8 @@
SensorsInfo fromLabeledSensorsInfo(const std::vector<LabeledSensorInfo>& infos);
-TriggerThresholdParams
- fromLabeledThresholdParam(const std::vector<LabeledThresholdParam>& params);
+TriggerThresholdParams fromLabeledThresholdParam(
+ const std::vector<LabeledThresholdParam>& params);
nlohmann::json labeledThresholdParamsToJson(
const LabeledTriggerThresholdParams& labeledThresholdParams);
diff --git a/src/utils/dbus_mapper.hpp b/src/utils/dbus_mapper.hpp
index 5f07445..24adc7a 100644
--- a/src/utils/dbus_mapper.hpp
+++ b/src/utils/dbus_mapper.hpp
@@ -20,9 +20,9 @@
constexpr std::array<const char*, 1> sensorInterfaces = {
"xyz.openbmc_project.Sensor.Value"};
-inline std::vector<SensorTree>
- getSubTreeSensors(boost::asio::yield_context& yield,
- const std::shared_ptr<sdbusplus::asio::connection>& bus)
+inline std::vector<SensorTree> getSubTreeSensors(
+ boost::asio::yield_context& yield,
+ const std::shared_ptr<sdbusplus::asio::connection>& bus)
{
boost::system::error_code ec;
@@ -38,8 +38,8 @@
return tree;
}
-inline std::vector<SensorTree>
- getSubTreeSensors(const std::shared_ptr<sdbusplus::asio::connection>& bus)
+inline std::vector<SensorTree> getSubTreeSensors(
+ const std::shared_ptr<sdbusplus::asio::connection>& bus)
{
auto method_call =
bus->new_method_call("xyz.openbmc_project.ObjectMapper",
diff --git a/src/utils/dbus_path_utils.hpp b/src/utils/dbus_path_utils.hpp
index c1bda62..4e287e8 100644
--- a/src/utils/dbus_path_utils.hpp
+++ b/src/utils/dbus_path_utils.hpp
@@ -25,10 +25,10 @@
constexpr size_t maxIdNameLength{TELEMETRY_MAX_ID_NAME_LENGTH};
constexpr size_t maxDbusPathLength{TELEMETRY_MAX_DBUS_PATH_LENGTH};
-constexpr size_t maxTriggeFullIdLength{maxDbusPathLength -
- triggerDirStr.length()};
-constexpr size_t maxReportFullIdLength{maxDbusPathLength -
- reportDirStr.length()};
+constexpr size_t maxTriggeFullIdLength{
+ maxDbusPathLength - triggerDirStr.length()};
+constexpr size_t maxReportFullIdLength{
+ maxDbusPathLength - reportDirStr.length()};
static_assert(maxPrefixesInId * (maxPrefixLength + 1) + maxIdNameLength <=
maxTriggeFullIdLength,
diff --git a/src/utils/labeled_tuple.hpp b/src/utils/labeled_tuple.hpp
index 062b908..7c05a58 100644
--- a/src/utils/labeled_tuple.hpp
+++ b/src/utils/labeled_tuple.hpp
@@ -110,8 +110,8 @@
static U& ref();
template <class U>
- static std::true_type
- check(decltype(utils::to_json(ref<nlohmann::json>(), ref<const U>()))*);
+ static std::true_type check(decltype(utils::to_json(ref<nlohmann::json>(),
+ ref<const U>()))*);
template <class>
static std::false_type check(...);
@@ -205,11 +205,15 @@
bool operator==(const LabeledTuple& other) const
{
- return std::apply([&](auto&&... x) {
- return std::apply([&](auto&&... y) {
- return (true && ... && detail::eq(x, y));
- }, value);
- }, other.value);
+ return std::apply(
+ [&](auto&&... x) {
+ return std::apply(
+ [&](auto&&... y) {
+ return (true && ... && detail::eq(x, y));
+ },
+ value);
+ },
+ other.value);
}
bool operator<(const LabeledTuple& other) const
diff --git a/src/utils/make_id_name.cpp b/src/utils/make_id_name.cpp
index 0f78ab6..cc53a24 100644
--- a/src/utils/make_id_name.cpp
+++ b/src/utils/make_id_name.cpp
@@ -49,16 +49,19 @@
{
strippedId = defaultName;
}
- strippedId.erase(std::remove_if(strippedId.begin(), strippedId.end(),
- [](char c) {
- return c == '/' || utils::constants::allowedCharactersInPath.find(c) ==
- std::string_view::npos;
- }),
- strippedId.end());
+ strippedId.erase(
+ std::remove_if(
+ strippedId.begin(), strippedId.end(),
+ [](char c) {
+ return c == '/' ||
+ utils::constants::allowedCharactersInPath.find(c) ==
+ std::string_view::npos;
+ }),
+ strippedId.end());
size_t idx = 0;
- std::string tmpId = prefixes +
- strippedId.substr(0, constants::maxIdNameLength);
+ std::string tmpId =
+ prefixes + strippedId.substr(0, constants::maxIdNameLength);
while (std::find(conflictIds.begin(), conflictIds.end(), tmpId) !=
conflictIds.end())
@@ -83,10 +86,9 @@
} // namespace details
-std::pair<std::string, std::string>
- makeIdName(std::string_view id, std::string_view name,
- std::string_view defaultName,
- const std::vector<std::string>& conflictIds)
+std::pair<std::string, std::string> makeIdName(
+ std::string_view id, std::string_view name, std::string_view defaultName,
+ const std::vector<std::string>& conflictIds)
{
if (name.length() > constants::maxIdNameLength)
{
diff --git a/src/utils/make_id_name.hpp b/src/utils/make_id_name.hpp
index 2c4ce75..55c169b 100644
--- a/src/utils/make_id_name.hpp
+++ b/src/utils/make_id_name.hpp
@@ -7,9 +7,8 @@
namespace utils
{
-std::pair<std::string, std::string>
- makeIdName(std::string_view id, std::string_view name,
- std::string_view defaultName,
- const std::vector<std::string>& conflictIds);
+std::pair<std::string, std::string> makeIdName(
+ std::string_view id, std::string_view name, std::string_view defaultName,
+ const std::vector<std::string>& conflictIds);
} // namespace utils
diff --git a/src/utils/messanger_service.cpp b/src/utils/messanger_service.cpp
index 56c38f6..e04de34 100644
--- a/src/utils/messanger_service.cpp
+++ b/src/utils/messanger_service.cpp
@@ -18,8 +18,8 @@
{
contexts_.erase(std::remove_if(contexts_.begin(), contexts_.end(),
[&context](const auto& item) {
- return item.get() == &context;
- }),
+ return item.get() == &context;
+ }),
contexts_.end());
}
diff --git a/src/utils/threshold_operations.hpp b/src/utils/threshold_operations.hpp
index 99ae4a5..f75c12a 100644
--- a/src/utils/threshold_operations.hpp
+++ b/src/utils/threshold_operations.hpp
@@ -18,9 +18,8 @@
}
template <typename ThresholdType>
- static typename ThresholdType::ThresholdDetail&
- getDetails(ThresholdType* thresholdPtr,
- const interfaces::Sensor& sensor)
+ static typename ThresholdType::ThresholdDetail& getDetails(
+ ThresholdType* thresholdPtr, const interfaces::Sensor& sensor)
{
auto it = std::find_if(
thresholdPtr->sensorDetails.begin(),