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: I7801712fe34e10fec586d1e962afebd9ebcce46c
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/callback.hpp b/src/callback.hpp
index 2ee8282..49d16a2 100644
--- a/src/callback.hpp
+++ b/src/callback.hpp
@@ -235,13 +235,13 @@
{
if (!timer)
{
- timer = std::make_unique<TimerType>(
- sdeventplus::Event::get_default(),
- // **INDENT-OFF**
- [this](auto& /* source */) {
- // The timer uses the context saved on timer enable
- this->ConditionalCallback<CallbackAccess>::operator()(
- this->ctx);
+ timer =
+ std::make_unique<TimerType>(sdeventplus::Event::get_default(),
+ // **INDENT-OFF**
+ [this](auto& /* source */) {
+ // The timer uses the context saved on timer enable
+ this->ConditionalCallback<CallbackAccess>::operator()(
+ this->ctx);
});
// **INDENT-ON**
}
diff --git a/src/count.hpp b/src/count.hpp
index f5c4bb3..efc00fe 100644
--- a/src/count.hpp
+++ b/src/count.hpp
@@ -55,27 +55,26 @@
{
// Count the number of properties in the index that
// pass the condition specified in the config file.
- auto count = std::count_if(
- index.cbegin(), index.cend(),
- [this](const auto& item)
- // *INDENT-OFF*
+ auto count = std::count_if(index.cbegin(), index.cend(),
+ [this](const auto& item)
+ // *INDENT-OFF*
+ {
+ // Get the property value from storage[0],
+ // and save the op result in storage[1].
+ const auto& storage = std::get<storageIndex>(item.second);
+ // Don't count properties that don't exist.
+ if (!std::get<valueIndex>(storage.get()).has_value())
{
- // Get the property value from storage[0],
- // and save the op result in storage[1].
- const auto& storage = std::get<storageIndex>(item.second);
- // Don't count properties that don't exist.
- if (!std::get<valueIndex>(storage.get()).has_value())
- {
- return false;
- }
- const auto& value =
- std::any_cast<T>(std::get<valueIndex>(storage.get()));
- auto r = propertyOp(value);
+ return false;
+ }
+ const auto& value =
+ std::any_cast<T>(std::get<valueIndex>(storage.get()));
+ auto r = propertyOp(value);
- std::get<resultIndex>(storage.get()) = r;
+ std::get<resultIndex>(storage.get()) = r;
- return r;
- });
+ return r;
+ });
// *INDENT-ON*
// Now apply the count condition to the count.
diff --git a/src/elog.hpp b/src/elog.hpp
index c02a20b..a7e4e1c 100644
--- a/src/elog.hpp
+++ b/src/elog.hpp
@@ -51,8 +51,7 @@
ElogBase& operator=(const ElogBase&) = delete;
ElogBase& operator=(ElogBase&&) = default;
virtual ~ElogBase() = default;
- ElogBase() : Callback()
- {}
+ ElogBase() : Callback() {}
/** @brief Callback interface implementation. */
void operator()(Context ctx) override;
diff --git a/src/event.hpp b/src/event.hpp
index a4372c6..9292a99 100644
--- a/src/event.hpp
+++ b/src/event.hpp
@@ -29,8 +29,7 @@
EventBase& operator=(const EventBase&) = delete;
EventBase& operator=(EventBase&&) = default;
virtual ~EventBase() = default;
- EventBase(const PropertyIndex& index) : IndexedCallback(index)
- {}
+ EventBase(const PropertyIndex& index) : IndexedCallback(index) {}
/** @brief Callback interface implementation. */
void operator()(Context ctx) override
diff --git a/src/event_manager.cpp b/src/event_manager.cpp
index 72813cc..c0c0c4a 100644
--- a/src/event_manager.cpp
+++ b/src/event_manager.cpp
@@ -62,8 +62,8 @@
std::chrono::system_clock::now().time_since_epoch())
.count();
- auto objPath =
- std::string(OBJ_EVENT) + '/' + eventName + '/' + std::to_string(id);
+ auto objPath = std::string(OBJ_EVENT) + '/' + eventName + '/' +
+ std::to_string(id);
// check for capping of the events,if cap reached then erase the oldest
// event.
@@ -77,10 +77,10 @@
fs::remove(eventPath, ec);
}
- auto event =
- std::make_unique<Entry>(objPath,
- ms, // Milliseconds since 1970
- std::move(msg), std::move(additionalData));
+ auto event = std::make_unique<Entry>(objPath,
+ ms, // Milliseconds since 1970
+ std::move(msg),
+ std::move(additionalData));
serialize(*event, eventName);
eventQueue.push(std::move(event));
}
@@ -109,8 +109,8 @@
auto validEvent = false;
auto timestamp = eventFile.path().filename().string();
auto tsNum = std::stoll(timestamp);
- auto objPath =
- std::string(OBJ_EVENT) + '/' + eventName + '/' + timestamp;
+ auto objPath = std::string(OBJ_EVENT) + '/' + eventName + '/' +
+ timestamp;
auto event = std::make_unique<Entry>(objPath, tsNum);
if (deserialize(eventFile.path(), *event))
diff --git a/src/pathwatch.cpp b/src/pathwatch.cpp
index 302e532..b823fe7 100644
--- a/src/pathwatch.cpp
+++ b/src/pathwatch.cpp
@@ -1 +1 @@
-#include "pathwatchimpl.hpp"
\ No newline at end of file
+#include "pathwatchimpl.hpp"
diff --git a/src/propertywatchimpl.hpp b/src/propertywatchimpl.hpp
index cf97f63..8861793 100644
--- a/src/propertywatchimpl.hpp
+++ b/src/propertywatchimpl.hpp
@@ -78,10 +78,10 @@
[this](auto& msg)
// *INDENT-OFF*
{
- std::string interface;
- msg.read(interface);
- auto path = msg.get_path();
- this->propertiesChanged(msg, path, interface);
+ std::string interface;
+ msg.read(interface);
+ auto path = msg.get_path();
+ this->propertiesChanged(msg, path, interface);
});
// *INDENT-ON*
diff --git a/src/resolve_errors.hpp b/src/resolve_errors.hpp
index d8038ba..2133d1e 100644
--- a/src/resolve_errors.hpp
+++ b/src/resolve_errors.hpp
@@ -33,8 +33,7 @@
* @param[in] callout - The callout whose errors need to be resolved.
* Normally an inventory path.
*/
- explicit ResolveCallout(const std::string& callout) : callout(callout)
- {}
+ explicit ResolveCallout(const std::string& callout) : callout(callout) {}
/**
* @brief Callback interface to resolve errors
diff --git a/src/snmp_trap.hpp b/src/snmp_trap.hpp
index 5453eb4..6f07550 100644
--- a/src/snmp_trap.hpp
+++ b/src/snmp_trap.hpp
@@ -56,14 +56,12 @@
SNMPTrap& operator=(const SNMPTrap&) = delete;
SNMPTrap& operator=(SNMPTrap&&) = default;
virtual ~SNMPTrap() = default;
- SNMPTrap() : Callback()
- {}
+ SNMPTrap() : Callback() {}
/** @brief Callback interface implementation.
* @param[in] ctc - context.
*/
- void operator()(Context /* ctx */) override
- {}
+ void operator()(Context /* ctx */) override {}
/** @brief Callback interface implementation.
* @param[in] ctc - context.
diff --git a/src/test/interfaceaddtest.cpp b/src/test/interfaceaddtest.cpp
index aabacf0..55086f0 100644
--- a/src/test/interfaceaddtest.cpp
+++ b/src/test/interfaceaddtest.cpp
@@ -27,4 +27,4 @@
TEST(InterfaceAddTest, WatchSameSize)
{
ASSERT_EQ(expectedWatches.size(), pathwatches.size());
-}
\ No newline at end of file
+}