clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.
Change-Id: I1ac255c58971ac5cc4697b8bb1069067aad02d18
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/utils/conversion.hpp b/src/utils/conversion.hpp
index e92249a..f528044 100644
--- a/src/utils/conversion.hpp
+++ b/src/utils/conversion.hpp
@@ -90,9 +90,10 @@
inline T toEnum(const std::array<std::pair<std::string_view, T>, N>& data,
const std::string& value)
{
- auto it = std::find_if(
- std::begin(data), std::end(data),
- [&value](const auto& item) { return item.first == value; });
+ auto it = std::find_if(std::begin(data), std::end(data),
+ [&value](const auto& item) {
+ return item.first == value;
+ });
if (it == std::end(data))
{
throwConversionError(EnumTraits<T>::propertyName);
@@ -105,9 +106,10 @@
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),
- [value](const auto& item) { return item.second == value; });
+ auto it = std::find_if(std::begin(data), std::end(data),
+ [value](const auto& item) {
+ return item.second == value;
+ });
if (it == std::end(data))
{
throwConversionError(EnumTraits<T>::propertyName);
diff --git a/src/utils/conversion_trigger.cpp b/src/utils/conversion_trigger.cpp
index d65eae9..a8417e5 100644
--- a/src/utils/conversion_trigger.cpp
+++ b/src/utils/conversion_trigger.cpp
@@ -21,8 +21,8 @@
const std::vector<numeric::ThresholdParam>& arg) const
{
return utils::transform(arg, [](const auto& thresholdParam) {
- const auto& [type, dwellTime, direction, thresholdValue] =
- thresholdParam;
+ 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, discrete::toSeverity(severity), dwellTime, thresholdValue);
});
@@ -44,14 +44,14 @@
const std::vector<numeric::LabeledThresholdParam>& arg) const
{
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>());
+ 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>());
});
}
diff --git a/src/utils/conversion_trigger.hpp b/src/utils/conversion_trigger.hpp
index 8719df2..10b0c03 100644
--- a/src/utils/conversion_trigger.hpp
+++ b/src/utils/conversion_trigger.hpp
@@ -45,8 +45,8 @@
inline constexpr bool is_variant_v = is_variant<T>::value;
template <typename AlternativeT, typename VariantT>
- requires is_variant_v<VariantT> bool
-isFirstElementOfType(const std::vector<VariantT>& collection)
+ requires is_variant_v<VariantT>
+bool isFirstElementOfType(const std::vector<VariantT>& collection)
{
if (collection.empty())
{
diff --git a/src/utils/ensure.hpp b/src/utils/ensure.hpp
index 8c4fc99..8b7567e 100644
--- a/src/utils/ensure.hpp
+++ b/src/utils/ensure.hpp
@@ -15,8 +15,7 @@
Ensure(U&& functor) : functor(std::forward<U>(functor))
{}
- Ensure(F functor) : functor(std::move(functor))
- {}
+ Ensure(F functor) : functor(std::move(functor)) {}
Ensure(Ensure&& other) = delete;
Ensure(const Ensure&) = delete;
diff --git a/src/utils/labeled_tuple.hpp b/src/utils/labeled_tuple.hpp
index c4120c9..b320c3b 100644
--- a/src/utils/labeled_tuple.hpp
+++ b/src/utils/labeled_tuple.hpp
@@ -151,10 +151,8 @@
LabeledTuple(const LabeledTuple&) = default;
LabeledTuple(LabeledTuple&&) = default;
- explicit LabeledTuple(tuple_type v) : value(std::move(v))
- {}
- LabeledTuple(Args... args) : value(std::move(args)...)
- {}
+ explicit LabeledTuple(tuple_type v) : value(std::move(v)) {}
+ LabeledTuple(Args... args) : value(std::move(args)...) {}
LabeledTuple& operator=(const LabeledTuple&) = default;
LabeledTuple& operator=(LabeledTuple&&) = default;
@@ -209,11 +207,9 @@
{
return std::apply(
[&](auto&&... x) {
- return std::apply(
- [&](auto&&... y) {
- return (true && ... && detail::eq(x, y));
- },
- value);
+ return std::apply(
+ [&](auto&&... y) { return (true && ... && detail::eq(x, y)); },
+ value);
},
other.value);
}
diff --git a/src/utils/make_id_name.cpp b/src/utils/make_id_name.cpp
index 1390dad..1148622 100644
--- a/src/utils/make_id_name.cpp
+++ b/src/utils/make_id_name.cpp
@@ -49,19 +49,17 @@
{
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())
diff --git a/src/utils/messanger_service.cpp b/src/utils/messanger_service.cpp
index e04de34..25f154c 100644
--- a/src/utils/messanger_service.cpp
+++ b/src/utils/messanger_service.cpp
@@ -16,11 +16,11 @@
void MessangerService::destroy(MessangerService::Context& context)
{
- contexts_.erase(std::remove_if(contexts_.begin(), contexts_.end(),
- [&context](const auto& item) {
- return item.get() == &context;
- }),
- contexts_.end());
+ contexts_.erase(
+ std::remove_if(
+ contexts_.begin(), contexts_.end(),
+ [&context](const auto& item) { return item.get() == &context; }),
+ contexts_.end());
}
boost::asio::execution_context::id MessangerService::id = {};
diff --git a/src/utils/messanger_service.hpp b/src/utils/messanger_service.hpp
index 86dd2ff..f79bcc7 100644
--- a/src/utils/messanger_service.hpp
+++ b/src/utils/messanger_service.hpp
@@ -20,8 +20,7 @@
MessangerService(boost::asio::execution_context& execution_context);
~MessangerService() = default;
- void shutdown()
- {}
+ void shutdown() {}
Context& create();
void destroy(Context& context);
diff --git a/src/utils/threshold_operations.hpp b/src/utils/threshold_operations.hpp
index 99ae4a5..42d469e 100644
--- a/src/utils/threshold_operations.hpp
+++ b/src/utils/threshold_operations.hpp
@@ -22,10 +22,11 @@
getDetails(ThresholdType* thresholdPtr,
const interfaces::Sensor& sensor)
{
- auto it = std::find_if(
- thresholdPtr->sensorDetails.begin(),
- thresholdPtr->sensorDetails.end(),
- [&sensor](const auto& x) { return &sensor == x.first.get(); });
+ auto it = std::find_if(thresholdPtr->sensorDetails.begin(),
+ thresholdPtr->sensorDetails.end(),
+ [&sensor](const auto& x) {
+ return &sensor == x.first.get();
+ });
return *it->second;
}