diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -87,7 +87,7 @@
 IndentWrappedFunctionNames: true
 InsertNewlineAtEOF: true
 KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
 LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
@@ -98,13 +98,14 @@
 ObjCSpaceBeforeProtocolList: true
 PackConstructorInitializers: BinPack
 PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
 PenaltyBreakComment: 300
 PenaltyBreakFirstLessLess: 120
 PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
 PointerAlignment: Left
 QualifierAlignment: Left
 ReferenceAlignment: Left
diff --git a/control/actions.cpp b/control/actions.cpp
index 25db5a9..1a40ce8 100644
--- a/control/actions.cpp
+++ b/control/actions.cpp
@@ -73,9 +73,10 @@
         // Set/update the services of the group
         zone.setServices(&group);
         auto services = zone.getGroupServices(&group);
-        auto missingOwner = std::any_of(
-            services.begin(), services.end(),
-            [](const auto& s) { return !std::get<hasOwnerPos>(s); });
+        auto missingOwner =
+            std::any_of(services.begin(), services.end(), [](const auto& s) {
+                return !std::get<hasOwnerPos>(s);
+            });
         if (missingOwner)
         {
             zone.setSpeed(speed);
@@ -88,20 +89,20 @@
 void set_request_speed_base_with_max(control::Zone& zone, const Group& group)
 {
     int64_t base = 0;
-    std::for_each(group.begin(), group.end(),
-                  [&zone, &base](const auto& entry) {
-        try
-        {
-            auto value = zone.template getPropertyValue<int64_t>(
-                std::get<pathPos>(entry), std::get<intfPos>(entry),
-                std::get<propPos>(entry));
-            base = std::max(base, value);
-        }
-        catch (const std::out_of_range& oore)
-        {
-            // Property value not found, base request speed unchanged
-        }
-    });
+    std::for_each(
+        group.begin(), group.end(), [&zone, &base](const auto& entry) {
+            try
+            {
+                auto value = zone.template getPropertyValue<int64_t>(
+                    std::get<pathPos>(entry), std::get<intfPos>(entry),
+                    std::get<propPos>(entry));
+                base = std::max(base, value);
+            }
+            catch (const std::out_of_range& oore)
+            {
+                // Property value not found, base request speed unchanged
+            }
+        });
     // A request speed base of 0 defaults to the current target speed
     zone.setRequestSpeedBase(base);
 }
diff --git a/control/actions.hpp b/control/actions.hpp
index fd7c8a6..fd9ad62 100644
--- a/control/actions.hpp
+++ b/control/actions.hpp
@@ -85,8 +85,8 @@
 template <typename T>
 auto count_state_before_speed(size_t count, T&& state, uint64_t speed)
 {
-    return [count, speed, state = std::forward<T>(state)](auto& zone,
-                                                          auto& group) {
+    return [count, speed,
+            state = std::forward<T>(state)](auto& zone, auto& group) {
         size_t numAtState = 0;
         for (auto& entry : group)
         {
@@ -135,30 +135,30 @@
         if (group.size() != 0)
         {
             auto count = 0;
-            auto sumValue =
-                std::accumulate(group.begin(), group.end(), 0,
-                                [&zone, &count](T sum, auto const& entry) {
-                try
-                {
-                    return sum + zone.template getPropertyValue<T>(
-                                     std::get<pathPos>(entry),
-                                     std::get<intfPos>(entry),
-                                     std::get<propPos>(entry));
-                }
-                catch (const std::out_of_range& oore)
-                {
-                    count++;
-                    return sum;
-                }
-            });
+            auto sumValue = std::accumulate(
+                group.begin(), group.end(), 0,
+                [&zone, &count](T sum, const auto& entry) {
+                    try
+                    {
+                        return sum + zone.template getPropertyValue<T>(
+                                         std::get<pathPos>(entry),
+                                         std::get<intfPos>(entry),
+                                         std::get<propPos>(entry));
+                    }
+                    catch (const std::out_of_range& oore)
+                    {
+                        count++;
+                        return sum;
+                    }
+                });
             if ((group.size() - count) > 0)
             {
                 auto groupSize = static_cast<int64_t>(group.size());
                 auto avgValue = sumValue / (groupSize - count);
                 auto it = std::find_if(val_to_speed.begin(), val_to_speed.end(),
-                                       [&avgValue](auto const& entry) {
-                    return avgValue < entry.first;
-                });
+                                       [&avgValue](const auto& entry) {
+                                           return avgValue < entry.first;
+                                       });
                 if (it != std::end(val_to_speed))
                 {
                     speed = (*it).second;
@@ -187,28 +187,28 @@
 Action
     set_ceiling_from_average_sensor_value(std::map<T, uint64_t>&& val_to_speed)
 {
-    return [val_to_speed = std::move(val_to_speed)](Zone& zone,
-                                                    const Group& group) {
+    return [val_to_speed =
+                std::move(val_to_speed)](Zone& zone, const Group& group) {
         auto speed = zone.getCeiling();
         if (group.size() != 0)
         {
             auto count = 0;
-            auto sumValue =
-                std::accumulate(group.begin(), group.end(), 0,
-                                [&zone, &count](T sum, auto const& entry) {
-                try
-                {
-                    return sum + zone.template getPropertyValue<T>(
-                                     std::get<pathPos>(entry),
-                                     std::get<intfPos>(entry),
-                                     std::get<propPos>(entry));
-                }
-                catch (const std::out_of_range& oore)
-                {
-                    count++;
-                    return sum;
-                }
-            });
+            auto sumValue = std::accumulate(
+                group.begin(), group.end(), 0,
+                [&zone, &count](T sum, const auto& entry) {
+                    try
+                    {
+                        return sum + zone.template getPropertyValue<T>(
+                                         std::get<pathPos>(entry),
+                                         std::get<intfPos>(entry),
+                                         std::get<propPos>(entry));
+                    }
+                    catch (const std::out_of_range& oore)
+                    {
+                        count++;
+                        return sum;
+                    }
+                });
             if ((group.size() - count) > 0)
             {
                 auto groupSize = static_cast<int64_t>(group.size());
@@ -307,33 +307,34 @@
     return [speedDelta, factor = std::forward<T>(factor),
             state = std::forward<T>(state)](auto& zone, auto& group) {
         auto netDelta = zone.getIncSpeedDelta();
-        std::for_each(group.begin(), group.end(),
-                      [&zone, &state, &factor, &speedDelta,
-                       &netDelta](auto const& entry) {
-            try
-            {
-                T value = zone.template getPropertyValue<T>(
-                    std::get<pathPos>(entry), std::get<intfPos>(entry),
-                    std::get<propPos>(entry));
-                // TODO openbmc/phosphor-fan-presence#7 - Support possible
-                // state types for comparison
-                if (value >= state)
+        std::for_each(
+            group.begin(), group.end(),
+            [&zone, &state, &factor, &speedDelta,
+             &netDelta](const auto& entry) {
+                try
                 {
-                    // Increase by at least a single delta(factor)
-                    // to attempt bringing under 'state'
-                    auto delta = std::max((value - state), factor);
-                    // Increase is the factor applied to the
-                    // difference times the given speed delta
-                    netDelta = std::max(
-                        netDelta,
-                        static_cast<uint64_t>((delta / factor) * speedDelta));
+                    T value = zone.template getPropertyValue<T>(
+                        std::get<pathPos>(entry), std::get<intfPos>(entry),
+                        std::get<propPos>(entry));
+                    // TODO openbmc/phosphor-fan-presence#7 - Support possible
+                    // state types for comparison
+                    if (value >= state)
+                    {
+                        // Increase by at least a single delta(factor)
+                        // to attempt bringing under 'state'
+                        auto delta = std::max((value - state), factor);
+                        // Increase is the factor applied to the
+                        // difference times the given speed delta
+                        netDelta = std::max(netDelta,
+                                            static_cast<uint64_t>(
+                                                (delta / factor) * speedDelta));
+                    }
                 }
-            }
-            catch (const std::out_of_range& oore)
-            {
-                // Property value not found, netDelta unchanged
-            }
-        });
+                catch (const std::out_of_range& oore)
+                {
+                    // Property value not found, netDelta unchanged
+                }
+            });
         // Request speed change for target speed update
         zone.requestSpeedIncrease(netDelta);
     };
@@ -380,8 +381,8 @@
                         // difference times the given speed delta
                         netDelta = std::min(
                             netDelta,
-                            static_cast<uint64_t>(((state - value) / factor) *
-                                                  speedDelta));
+                            static_cast<uint64_t>(
+                                ((state - value) / factor) * speedDelta));
                     }
                 }
                 else
@@ -426,20 +427,21 @@
     return [state = std::forward<T>(state), defEvents = std::move(defEvents),
             altEvents = std::move(altEvents)](auto& zone, auto& group) {
         // Compare all group entries to the state
-        auto useAlt = std::all_of(group.begin(), group.end(),
-                                  [&zone, &state](auto const& entry) {
-            try
-            {
-                return zone.template getPropertyValue<T>(
-                           std::get<pathPos>(entry), std::get<intfPos>(entry),
-                           std::get<propPos>(entry)) == state;
-            }
-            catch (const std::out_of_range& oore)
-            {
-                // Default to property not equal when not found
-                return false;
-            }
-        });
+        auto useAlt = std::all_of(
+            group.begin(), group.end(), [&zone, &state](const auto& entry) {
+                try
+                {
+                    return zone.template getPropertyValue<T>(
+                               std::get<pathPos>(entry),
+                               std::get<intfPos>(entry),
+                               std::get<propPos>(entry)) == state;
+                }
+                catch (const std::out_of_range& oore)
+                {
+                    // Default to property not equal when not found
+                    return false;
+                }
+            });
 
         const std::vector<SetSpeedEvent>* rmEvents = &altEvents;
         const std::vector<SetSpeedEvent>* initEvents = &defEvents;
@@ -452,10 +454,10 @@
 
         // Remove events
         std::for_each(rmEvents->begin(), rmEvents->end(),
-                      [&zone](auto const& entry) { zone.removeEvent(entry); });
+                      [&zone](const auto& entry) { zone.removeEvent(entry); });
         // Init events
         std::for_each(initEvents->begin(), initEvents->end(),
-                      [&zone](auto const& entry) { zone.initEvent(entry); });
+                      [&zone](const auto& entry) { zone.initEvent(entry); });
     };
 }
 
@@ -488,7 +490,7 @@
         if (group.size() != 0)
         {
             std::vector<T> validValues;
-            for (auto const& member : group)
+            for (const auto& member : group)
             {
                 try
                 {
@@ -525,9 +527,9 @@
 
                 // Use determined median sensor value to find floor speed
                 auto it = std::find_if(valueToSpeed.begin(), valueToSpeed.end(),
-                                       [&median](auto const& entry) {
-                    return median < entry.first;
-                });
+                                       [&median](const auto& entry) {
+                                           return median < entry.first;
+                                       });
                 if (it != std::end(valueToSpeed))
                 {
                     speed = (*it).second;
@@ -554,20 +556,21 @@
 auto update_default_floor(T&& state, uint64_t speed)
 {
     return [speed, state = std::forward<T>(state)](auto& zone, auto& group) {
-        auto updateDefFloor = std::all_of(group.begin(), group.end(),
-                                          [&zone, &state](auto const& entry) {
-            try
-            {
-                return zone.template getPropertyValue<T>(
-                           std::get<pathPos>(entry), std::get<intfPos>(entry),
-                           std::get<propPos>(entry)) == state;
-            }
-            catch (const std::out_of_range& oore)
-            {
-                // Default to property not equal when not found
-                return false;
-            }
-        });
+        auto updateDefFloor = std::all_of(
+            group.begin(), group.end(), [&zone, &state](const auto& entry) {
+                try
+                {
+                    return zone.template getPropertyValue<T>(
+                               std::get<pathPos>(entry),
+                               std::get<intfPos>(entry),
+                               std::get<propPos>(entry)) == state;
+                }
+                catch (const std::out_of_range& oore)
+                {
+                    // Default to property not equal when not found
+                    return false;
+                }
+            });
 
         if (!updateDefFloor)
         {
@@ -599,34 +602,37 @@
     return [state = std::forward<T>(state),
             events = std::move(events)](auto& zone, auto& group) {
         // Compare all group entries to the state
-        auto useEvents = std::all_of(group.begin(), group.end(),
-                                     [&zone, &state](auto const& entry) {
-            try
-            {
-                return zone.template getPropertyValue<T>(
-                           std::get<pathPos>(entry), std::get<intfPos>(entry),
-                           std::get<propPos>(entry)) == state;
-            }
-            catch (const std::out_of_range& oore)
-            {
-                // Default to property not equal when not found
-                return false;
-            }
-        });
+        auto useEvents = std::all_of(
+            group.begin(), group.end(), [&zone, &state](const auto& entry) {
+                try
+                {
+                    return zone.template getPropertyValue<T>(
+                               std::get<pathPos>(entry),
+                               std::get<intfPos>(entry),
+                               std::get<propPos>(entry)) == state;
+                }
+                catch (const std::out_of_range& oore)
+                {
+                    // Default to property not equal when not found
+                    return false;
+                }
+            });
 
         if (useEvents)
         {
             // Init events
-            std::for_each(
-                events.begin(), events.end(),
-                [&zone](auto const& entry) { zone.initEvent(entry); });
+            std::for_each(events.begin(), events.end(),
+                          [&zone](const auto& entry) {
+                              zone.initEvent(entry);
+                          });
         }
         else
         {
             // Remove events
-            std::for_each(
-                events.begin(), events.end(),
-                [&zone](auto const& entry) { zone.removeEvent(entry); });
+            std::for_each(events.begin(), events.end(),
+                          [&zone](const auto& entry) {
+                              zone.removeEvent(entry);
+                          });
         }
     };
 }
diff --git a/control/fanctl.cpp b/control/fanctl.cpp
index d244a86..9789c24 100644
--- a/control/fanctl.cpp
+++ b/control/fanctl.cpp
@@ -80,10 +80,9 @@
  * @return map of paths by fan name
  */
 
-std::map<std::string, std::vector<std::string>>
-    getPathsFromIface(const std::string& path, const std::string& iface,
-                      const std::vector<std::string>& fans,
-                      bool shortPath = false)
+std::map<std::string, std::vector<std::string>> getPathsFromIface(
+    const std::string& path, const std::string& iface,
+    const std::vector<std::string>& fans, bool shortPath = false)
 {
     std::map<std::string, std::vector<std::string>> dest;
 
@@ -162,8 +161,8 @@
     }
 
     // load tach sensor paths for each fan
-    pathMap["tach"] = getPathsFromIface(paths["tach"],
-                                        interfaces["SensorValue"], fanNames);
+    pathMap["tach"] =
+        getPathsFromIface(paths["tach"], interfaces["SensorValue"], fanNames);
 
     // load inventory Item data for each fan
     pathMap["inventory"] = getPathsFromIface(
@@ -221,18 +220,18 @@
 
     std::string path("/xyz/openbmc_project/state/bmc0");
     std::string iface("xyz.openbmc_project.State.BMC");
-    ret[3] = SDBusPlus::getProperty<std::string>(path, iface,
-                                                 "CurrentBMCState");
+    ret[3] =
+        SDBusPlus::getProperty<std::string>(path, iface, "CurrentBMCState");
 
     path = "/xyz/openbmc_project/state/chassis0";
     iface = "xyz.openbmc_project.State.Chassis";
-    ret[4] = SDBusPlus::getProperty<std::string>(path, iface,
-                                                 "CurrentPowerState");
+    ret[4] =
+        SDBusPlus::getProperty<std::string>(path, iface, "CurrentPowerState");
 
     path = "/xyz/openbmc_project/state/host0";
     iface = "xyz.openbmc_project.State.Host";
-    ret[5] = SDBusPlus::getProperty<std::string>(path, iface,
-                                                 "CurrentHostState");
+    ret[5] =
+        SDBusPlus::getProperty<std::string>(path, iface, "CurrentHostState");
 
     return ret;
 }
@@ -725,8 +724,8 @@
 
 #ifdef CONTROL_USE_JSON
     // Query dump
-    auto cmdDumpQuery = commands->add_subcommand("query_dump",
-                                                 "Query the dump file");
+    auto cmdDumpQuery =
+        commands->add_subcommand("query_dump", "Query the dump file");
 
     cmdDumpQuery->set_help_flag("-h, --help", "Query the dump file");
     cmdDumpQuery
diff --git a/control/functor.hpp b/control/functor.hpp
index 14d27d2..fd6fe6a 100644
--- a/control/functor.hpp
+++ b/control/functor.hpp
@@ -93,8 +93,8 @@
     {}
     Properties(const char* path, const char* intf, const char* prop,
                U&& handler) :
-        _path(path),
-        _intf(intf), _prop(prop), _handler(std::forward<U>(handler))
+        _path(path), _intf(intf), _prop(prop),
+        _handler(std::forward<U>(handler))
     {}
 
     /** @brief Run signal handler function
@@ -125,8 +125,8 @@
             }
 
             // Retrieve the property's value applying any visitors necessary
-            auto value = zone.getPropertyValueVisitor<T>(_intf, _prop,
-                                                         it->second);
+            auto value =
+                zone.getPropertyValueVisitor<T>(_intf, _prop, it->second);
 
             _handler(zone, _path, _intf, _prop, std::forward<T>(value));
         }
@@ -160,23 +160,23 @@
         std::for_each(
             group.begin(), group.end(),
             [&zone, handler = std::move(_handler)](const auto& member) {
-            auto path = std::get<pathPos>(member);
-            auto intf = std::get<intfPos>(member);
-            auto prop = std::get<propPos>(member);
-            try
-            {
-                auto val = zone.getPropertyByName<T>(path, intf, prop);
-                handler(zone, path, intf, prop, std::forward<T>(val));
-            }
-            catch (const sdbusplus::exception_t&)
-            {
-                // Property value not sent to handler
-            }
-            catch (const util::DBusError&)
-            {
-                // Property value not sent to handler
-            }
-        });
+                auto path = std::get<pathPos>(member);
+                auto intf = std::get<intfPos>(member);
+                auto prop = std::get<propPos>(member);
+                try
+                {
+                    auto val = zone.getPropertyByName<T>(path, intf, prop);
+                    handler(zone, path, intf, prop, std::forward<T>(val));
+                }
+                catch (const sdbusplus::exception_t&)
+                {
+                    // Property value not sent to handler
+                }
+                catch (const util::DBusError&)
+                {
+                    // Property value not sent to handler
+                }
+            });
     }
 
   private:
@@ -236,8 +236,8 @@
     InterfacesAdded& operator=(InterfacesAdded&&) = default;
     InterfacesAdded(const char* path, const char* intf, const char* prop,
                     U&& handler) :
-        _path(path),
-        _intf(intf), _prop(prop), _handler(std::forward<U>(handler))
+        _path(path), _intf(intf), _prop(prop),
+        _handler(std::forward<U>(handler))
     {}
 
     /** @brief Run signal handler function
@@ -276,8 +276,8 @@
             }
 
             // Retrieve the property's value applying any visitors necessary
-            auto value = zone.getPropertyValueVisitor<T>(_intf, _prop,
-                                                         itProp->second);
+            auto value =
+                zone.getPropertyValueVisitor<T>(_intf, _prop, itProp->second);
 
             _handler(zone, _path, _intf, _prop, std::forward<T>(value));
         }
@@ -430,32 +430,33 @@
     {
         std::string name = "";
         bool hasOwner = false;
-        std::for_each(group.begin(), group.end(),
-                      [&zone, &group, &name, &hasOwner,
-                       handler = std::move(_handler)](const auto& member) {
-            auto path = std::get<pathPos>(member);
-            auto intf = std::get<intfPos>(member);
-            try
-            {
-                auto servName = zone.getService(path, intf);
-                if (name != servName)
+        std::for_each(
+            group.begin(), group.end(),
+            [&zone, &group, &name, &hasOwner,
+             handler = std::move(_handler)](const auto& member) {
+                auto path = std::get<pathPos>(member);
+                auto intf = std::get<intfPos>(member);
+                try
                 {
-                    name = servName;
-                    hasOwner = util::SDBusPlus::callMethodAndRead<bool>(
-                        zone.getBus(), "org.freedesktop.DBus",
-                        "/org/freedesktop/DBus", "org.freedesktop.DBus",
-                        "NameHasOwner", name);
-                    // Update service name owner state list of a group
-                    handler(zone, name, hasOwner);
+                    auto servName = zone.getService(path, intf);
+                    if (name != servName)
+                    {
+                        name = servName;
+                        hasOwner = util::SDBusPlus::callMethodAndRead<bool>(
+                            zone.getBus(), "org.freedesktop.DBus",
+                            "/org/freedesktop/DBus", "org.freedesktop.DBus",
+                            "NameHasOwner", name);
+                        // Update service name owner state list of a group
+                        handler(zone, name, hasOwner);
+                    }
                 }
-            }
-            catch (const util::DBusMethodError& e)
-            {
-                // Failed to get service name owner state
-                name = "";
-                hasOwner = false;
-            }
-        });
+                catch (const util::DBusMethodError& e)
+                {
+                    // Failed to get service name owner state
+                    name = "";
+                    hasOwner = false;
+                }
+            });
     }
 
   private:
diff --git a/control/json/actions/action.hpp b/control/json/actions/action.hpp
index 0377a8a..93cd9e2 100644
--- a/control/json/actions/action.hpp
+++ b/control/json/actions/action.hpp
@@ -153,10 +153,11 @@
      */
     virtual void addZone(Zone& zone)
     {
-        auto itZone = std::find_if(_zones.begin(), _zones.end(),
-                                   [&zone](std::reference_wrapper<Zone>& z) {
-            return z.get().getName() == zone.getName();
-        });
+        auto itZone =
+            std::find_if(_zones.begin(), _zones.end(),
+                         [&zone](std::reference_wrapper<Zone>& z) {
+                             return z.get().getName() == zone.getName();
+                         });
         if (itZone == _zones.end())
         {
             _zones.emplace_back(std::reference_wrapper<Zone>(zone));
@@ -223,8 +224,8 @@
         json groups = json::array();
         std::for_each(_groups.begin(), _groups.end(),
                       [&groups](const auto& group) {
-            groups.push_back(group.getName());
-        });
+                          groups.push_back(group.getName());
+                      });
         json output;
         output["groups"] = groups;
         return output;
@@ -331,11 +332,11 @@
         else
         {
             // Construct list of available actions
-            auto acts = std::accumulate(std::next(actions.begin()),
-                                        actions.end(), actions.begin()->first,
-                                        [](auto list, auto act) {
-                return std::move(list) + ", " + act.first;
-            });
+            auto acts = std::accumulate(
+                std::next(actions.begin()), actions.end(),
+                actions.begin()->first, [](auto list, auto act) {
+                    return std::move(list) + ", " + act.first;
+                });
             log<level::ERR>(
                 std::format("Action '{}' is not registered", name).c_str(),
                 entry("AVAILABLE_ACTIONS=%s", acts.c_str()));
diff --git a/control/json/actions/count_state_floor.cpp b/control/json/actions/count_state_floor.cpp
index 25cb3e6..a285a90 100644
--- a/control/json/actions/count_state_floor.cpp
+++ b/control/json/actions/count_state_floor.cpp
@@ -71,10 +71,10 @@
 
     if (!_timer)
     {
-        _timer = std::make_unique<Timer>(util::SDEventPlus::getEvent(),
-                                         [&zone, this](Timer&) {
-            zone.setFloorHold(getUniqueName(), _floor, doCount());
-        });
+        _timer = std::make_unique<Timer>(
+            util::SDEventPlus::getEvent(), [&zone, this](Timer&) {
+                zone.setFloorHold(getUniqueName(), _floor, doCount());
+            });
     }
 
     if (!_timer->isEnabled())
diff --git a/control/json/actions/default_floor.cpp b/control/json/actions/default_floor.cpp
index 95a2219..5ca3c10 100644
--- a/control/json/actions/default_floor.cpp
+++ b/control/json/actions/default_floor.cpp
@@ -43,8 +43,8 @@
         auto isMissingOwner =
             std::any_of(members.begin(), members.end(),
                         [&intf = group.getInterface()](const auto& member) {
-            return !Manager::hasOwner(member, intf);
-        });
+                            return !Manager::hasOwner(member, intf);
+                        });
         if (isMissingOwner)
         {
             zone.setFloor(zone.getDefaultFloor());
diff --git a/control/json/actions/get_managed_objects.cpp b/control/json/actions/get_managed_objects.cpp
index 099a68b..eb5600e 100644
--- a/control/json/actions/get_managed_objects.cpp
+++ b/control/json/actions/get_managed_objects.cpp
@@ -60,11 +60,11 @@
                 }
 
                 // Look for the ObjectManager as an ancestor of the path.
-                auto hasObjMgr = std::any_of(objMgrPaths.begin(),
-                                             objMgrPaths.end(),
-                                             [member](const auto& path) {
-                    return member.find(path) != std::string::npos;
-                });
+                auto hasObjMgr = std::any_of(
+                    objMgrPaths.begin(), objMgrPaths.end(),
+                    [member](const auto& path) {
+                        return member.find(path) != std::string::npos;
+                    });
 
                 if (!hasObjMgr || services.find(service) == services.end())
                 {
@@ -99,8 +99,8 @@
         // Add zone to _actions
         std::for_each(_actions.begin(), _actions.end(),
                       [&zone](std::unique_ptr<ActionBase>& action) {
-            action->addZone(zone);
-        });
+                          action->addZone(zone);
+                      });
     }
 }
 
diff --git a/control/json/actions/mapped_floor.cpp b/control/json/actions/mapped_floor.cpp
index 3de2188..ab50075 100644
--- a/control/json/actions/mapped_floor.cpp
+++ b/control/json/actions/mapped_floor.cpp
@@ -232,12 +232,13 @@
 {
     std::visit(
         [&value](auto&& val) {
-        using V = std::decay_t<decltype(val)>;
-        if constexpr (std::is_same_v<int32_t, V> || std::is_same_v<int64_t, V>)
-        {
-            value = static_cast<double>(val);
-        }
-    },
+            using V = std::decay_t<decltype(val)>;
+            if constexpr (std::is_same_v<int32_t, V> ||
+                          std::is_same_v<int64_t, V>)
+            {
+                value = static_cast<double>(val);
+            }
+        },
         value);
 }
 
@@ -261,17 +262,17 @@
             {
                 std::visit(
                     [&group, this](auto&& val) {
-                    using V = std::decay_t<decltype(val)>;
-                    if constexpr (!std::is_same_v<double, V> &&
-                                  !std::is_same_v<int32_t, V> &&
-                                  !std::is_same_v<int64_t, V>)
-                    {
-                        throw std::runtime_error{std::format(
-                            "{}: Group {} has more than one member but "
-                            "isn't numeric",
-                            ActionBase::getName(), group.getName())};
-                    }
-                },
+                        using V = std::decay_t<decltype(val)>;
+                        if constexpr (!std::is_same_v<double, V> &&
+                                      !std::is_same_v<int32_t, V> &&
+                                      !std::is_same_v<int64_t, V>)
+                        {
+                            throw std::runtime_error{std::format(
+                                "{}: Group {} has more than one member but "
+                                "isn't numeric",
+                                ActionBase::getName(), group.getName())};
+                        }
+                    },
                     value);
                 checked = true;
             }
diff --git a/control/json/actions/missing_owner_target.cpp b/control/json/actions/missing_owner_target.cpp
index deed3cb..40894be 100644
--- a/control/json/actions/missing_owner_target.cpp
+++ b/control/json/actions/missing_owner_target.cpp
@@ -46,8 +46,8 @@
         auto isMissingOwner =
             std::any_of(members.begin(), members.end(),
                         [&intf = group.getInterface()](const auto& member) {
-            return !Manager::hasOwner(member, intf);
-        });
+                            return !Manager::hasOwner(member, intf);
+                        });
         // Update zone's target hold based on action results
         zone.setTargetHold(group.getName(), _target, isMissingOwner);
     }
diff --git a/control/json/actions/net_target_increase.cpp b/control/json/actions/net_target_increase.cpp
index 7341a35..9c712a7 100644
--- a/control/json/actions/net_target_increase.cpp
+++ b/control/json/actions/net_target_increase.cpp
@@ -57,77 +57,80 @@
     for (const auto& group : _groups)
     {
         const auto& members = group.getMembers();
-        std::for_each(members.begin(), members.end(),
-                      [this, &zone, &group, &netDelta](const auto& member) {
-            try
-            {
-                auto value = Manager::getObjValueVariant(
-                    member, group.getInterface(), group.getProperty());
-                if (std::holds_alternative<int64_t>(value) ||
-                    std::holds_alternative<double>(value))
+        std::for_each(
+            members.begin(), members.end(),
+            [this, &zone, &group, &netDelta](const auto& member) {
+                try
                 {
-                    // Where a group of int/doubles are greater than or
-                    // equal to the state(some value) provided, request an
-                    // increase of the configured delta times the difference
-                    // between the group member's value and configured state
-                    // value.
-                    if (value >= _state)
+                    auto value = Manager::getObjValueVariant(
+                        member, group.getInterface(), group.getProperty());
+                    if (std::holds_alternative<int64_t>(value) ||
+                        std::holds_alternative<double>(value))
                     {
-                        uint64_t incDelta = 0;
-                        if (auto dblPtr = std::get_if<double>(&value))
+                        // Where a group of int/doubles are greater than or
+                        // equal to the state(some value) provided, request an
+                        // increase of the configured delta times the difference
+                        // between the group member's value and configured state
+                        // value.
+                        if (value >= _state)
                         {
-                            incDelta = static_cast<uint64_t>(
-                                (*dblPtr - std::get<double>(_state)) * _delta);
+                            uint64_t incDelta = 0;
+                            if (auto dblPtr = std::get_if<double>(&value))
+                            {
+                                incDelta = static_cast<uint64_t>(
+                                    (*dblPtr - std::get<double>(_state)) *
+                                    _delta);
+                            }
+                            else
+                            {
+                                // Increase by at least a single delta
+                                // to attempt bringing under provided 'state'
+                                auto deltaFactor =
+                                    std::max((std::get<int64_t>(value) -
+                                              std::get<int64_t>(_state)),
+                                             int64_t(1));
+                                incDelta =
+                                    static_cast<uint64_t>(deltaFactor * _delta);
+                            }
+                            netDelta = std::max(netDelta, incDelta);
                         }
-                        else
+                    }
+                    else if (std::holds_alternative<bool>(value))
+                    {
+                        // Where a group of booleans equal the state(`true` or
+                        // `false`) provided, request an increase of the
+                        // configured delta
+                        if (_state == value)
                         {
-                            // Increase by at least a single delta
-                            // to attempt bringing under provided 'state'
-                            auto deltaFactor =
-                                std::max((std::get<int64_t>(value) -
-                                          std::get<int64_t>(_state)),
-                                         int64_t(1));
-                            incDelta =
-                                static_cast<uint64_t>(deltaFactor * _delta);
+                            netDelta = std::max(netDelta, _delta);
                         }
-                        netDelta = std::max(netDelta, incDelta);
                     }
-                }
-                else if (std::holds_alternative<bool>(value))
-                {
-                    // Where a group of booleans equal the state(`true` or
-                    // `false`) provided, request an increase of the
-                    // configured delta
-                    if (_state == value)
+                    else if (std::holds_alternative<std::string>(value))
                     {
-                        netDelta = std::max(netDelta, _delta);
+                        // Where a group of strings equal the state(some string)
+                        // provided, request an increase of the configured delta
+                        if (_state == value)
+                        {
+                            netDelta = std::max(netDelta, _delta);
+                        }
                     }
-                }
-                else if (std::holds_alternative<std::string>(value))
-                {
-                    // Where a group of strings equal the state(some string)
-                    // provided, request an increase of the configured delta
-                    if (_state == value)
+                    else
                     {
-                        netDelta = std::max(netDelta, _delta);
+                        // Unsupported group member type for this action
+                        log<level::ERR>(
+                            std::format(
+                                "Action {}: Unsupported group member type "
+                                "given. [object = {} : {} : {}]",
+                                ActionBase::getName(), member,
+                                group.getInterface(), group.getProperty())
+                                .c_str());
                     }
                 }
-                else
+                catch (const std::out_of_range& oore)
                 {
-                    // Unsupported group member type for this action
-                    log<level::ERR>(
-                        std::format("Action {}: Unsupported group member type "
-                                    "given. [object = {} : {} : {}]",
-                                    ActionBase::getName(), member,
-                                    group.getInterface(), group.getProperty())
-                            .c_str());
+                    // Property value not found, netDelta unchanged
                 }
-            }
-            catch (const std::out_of_range& oore)
-            {
-                // Property value not found, netDelta unchanged
-            }
-        });
+            });
     }
     // Request increase to target
     zone.requestIncrease(netDelta);
diff --git a/control/json/actions/override_fan_target.cpp b/control/json/actions/override_fan_target.cpp
index 103008a..33fbd34 100644
--- a/control/json/actions/override_fan_target.cpp
+++ b/control/json/actions/override_fan_target.cpp
@@ -87,8 +87,8 @@
         {
             fanList = std::accumulate(std::next(_fans.begin()), _fans.end(),
                                       _fans[0], [](auto list, auto fan) {
-                return std::move(list) + ", " + fan;
-            });
+                                          return std::move(list) + ", " + fan;
+                                      });
         }
 
         record(std::format("Adding fan target lock of {} on fans [{}] zone {}",
diff --git a/control/json/actions/pcie_card_floors.cpp b/control/json/actions/pcie_card_floors.cpp
index 106d42f..a5cfee5 100644
--- a/control/json/actions/pcie_card_floors.cpp
+++ b/control/json/actions/pcie_card_floors.cpp
@@ -221,8 +221,8 @@
         auto deviceID = getPCIeDeviceProperty(card, deviceIDProp);
         auto vendorID = getPCIeDeviceProperty(card, vendorIDProp);
         auto subsystemID = getPCIeDeviceProperty(card, subsystemIDProp);
-        auto subsystemVendorID = getPCIeDeviceProperty(card,
-                                                       subsystemVendorIDProp);
+        auto subsystemVendorID =
+            getPCIeDeviceProperty(card, subsystemVendorIDProp);
 
         return _cardMetadata->lookup(deviceID, vendorID, subsystemID,
                                      subsystemVendorID);
@@ -251,10 +251,10 @@
 
     // Find the card that plugs in this slot based on if the
     // slot is part of the path, like slotA/cardA
-    auto it = std::find_if(_pcieDevices.begin(), _pcieDevices.end(),
-                           [slotPath](const auto& path) {
-        return path.find(slotPath + '/') != std::string::npos;
-    });
+    auto it = std::find_if(
+        _pcieDevices.begin(), _pcieDevices.end(), [slotPath](const auto& path) {
+            return path.find(slotPath + '/') != std::string::npos;
+        });
 
     if (it == _pcieDevices.end())
     {
diff --git a/control/json/actions/set_parameter_from_group_max.cpp b/control/json/actions/set_parameter_from_group_max.cpp
index 99e184f..811f37c 100644
--- a/control/json/actions/set_parameter_from_group_max.cpp
+++ b/control/json/actions/set_parameter_from_group_max.cpp
@@ -64,20 +64,20 @@
                 bool invalid = false;
                 std::visit(
                     [&group, &invalid, this](auto&& val) {
-                    using V = std::decay_t<decltype(val)>;
-                    if constexpr (!std::is_same_v<double, V> &&
-                                  !std::is_same_v<int32_t, V> &&
-                                  !std::is_same_v<int64_t, V>)
-                    {
-                        log<level::ERR>(std::format("{}: Group {} has more "
-                                                    "than one member but "
-                                                    "isn't numeric",
-                                                    ActionBase::getName(),
-                                                    group.getName())
-                                            .c_str());
-                        invalid = true;
-                    }
-                },
+                        using V = std::decay_t<decltype(val)>;
+                        if constexpr (!std::is_same_v<double, V> &&
+                                      !std::is_same_v<int32_t, V> &&
+                                      !std::is_same_v<int64_t, V>)
+                        {
+                            log<level::ERR>(std::format("{}: Group {} has more "
+                                                        "than one member but "
+                                                        "isn't numeric",
+                                                        ActionBase::getName(),
+                                                        group.getName())
+                                                .c_str());
+                            invalid = true;
+                        }
+                    },
                     value);
                 if (invalid)
                 {
diff --git a/control/json/actions/target_from_group_max.cpp b/control/json/actions/target_from_group_max.cpp
index 45216bb..d92457d 100644
--- a/control/json/actions/target_from_group_max.cpp
+++ b/control/json/actions/target_from_group_max.cpp
@@ -185,19 +185,19 @@
             // considered numeric here.
             std::visit(
                 [&group, &invalid, this](auto&& val) {
-                using V = std::decay_t<decltype(val)>;
-                if constexpr (!std::is_same_v<double, V> &&
-                              !std::is_same_v<int32_t, V> &&
-                              !std::is_same_v<int64_t, V>)
-                {
-                    log<level::ERR>(std::format("{}: Group {}'s member "
-                                                "isn't numeric",
-                                                ActionBase::getName(),
-                                                group.getName())
-                                        .c_str());
-                    invalid = true;
-                }
-            },
+                    using V = std::decay_t<decltype(val)>;
+                    if constexpr (!std::is_same_v<double, V> &&
+                                  !std::is_same_v<int32_t, V> &&
+                                  !std::is_same_v<int64_t, V>)
+                    {
+                        log<level::ERR>(
+                            std::format("{}: Group {}'s member "
+                                        "isn't numeric",
+                                        ActionBase::getName(), group.getName())
+                                .c_str());
+                        invalid = true;
+                    }
+                },
                 value);
             if (invalid)
             {
diff --git a/control/json/actions/timer_based_actions.cpp b/control/json/actions/timer_based_actions.cpp
index 02779bd..21dbc29 100644
--- a/control/json/actions/timer_based_actions.cpp
+++ b/control/json/actions/timer_based_actions.cpp
@@ -42,9 +42,10 @@
 {
     // If any of groups' value == nullopt(i.e. not configured), action is
     // driven by the service owned state of the group members
-    _byOwner = std::any_of(
-        _groups.begin(), _groups.end(),
-        [](const auto& group) { return group.getValue() == std::nullopt; });
+    _byOwner =
+        std::any_of(_groups.begin(), _groups.end(), [](const auto& group) {
+            return group.getValue() == std::nullopt;
+        });
 
     setTimerConf(jsonObj);
     setActions(jsonObj);
@@ -57,12 +58,13 @@
         // If any service providing a group member is not owned, start
         // timer and if all members' services are owned, stop timer.
         if (std::any_of(_groups.begin(), _groups.end(), [](const auto& group) {
-            const auto& members = group.getMembers();
-            return std::any_of(members.begin(), members.end(),
-                               [&group](const auto& member) {
-                return !Manager::hasOwner(member, group.getInterface());
-            });
-        }))
+                const auto& members = group.getMembers();
+                return std::any_of(
+                    members.begin(), members.end(),
+                    [&group](const auto& member) {
+                        return !Manager::hasOwner(member, group.getInterface());
+                    });
+            }))
         {
             startTimer();
         }
@@ -77,16 +79,18 @@
         // If all group members have a given value and it matches what's
         // in the cache, start timer and if any do not match, stop
         // timer.
-        if (std::all_of(_groups.begin(), _groups.end(),
-                        [&mgr](const auto& group) {
-            const auto& members = group.getMembers();
-            return std::all_of(members.begin(), members.end(),
-                               [&mgr, &group](const auto& member) {
-                return group.getValue() ==
-                       mgr->getProperty(member, group.getInterface(),
-                                        group.getProperty());
-            });
-        }))
+        if (std::all_of(
+                _groups.begin(), _groups.end(), [&mgr](const auto& group) {
+                    const auto& members = group.getMembers();
+                    return std::all_of(
+                        members.begin(), members.end(),
+                        [&mgr, &group](const auto& member) {
+                            return group.getValue() ==
+                                   mgr->getProperty(member,
+                                                    group.getInterface(),
+                                                    group.getProperty());
+                        });
+                }))
         {
             // Timer will be started(and never stopped) when _groups is empty
             startTimer();
@@ -143,8 +147,8 @@
         // Add zone to _actions
         std::for_each(_actions.begin(), _actions.end(),
                       [&zone](std::unique_ptr<ActionBase>& action) {
-            action->addZone(zone);
-        });
+                          action->addZone(zone);
+                      });
     }
 }
 
diff --git a/control/json/dbus_zone.cpp b/control/json/dbus_zone.cpp
index 6e269c3..a8cbe01 100644
--- a/control/json/dbus_zone.cpp
+++ b/control/json/dbus_zone.cpp
@@ -49,11 +49,11 @@
     std::transform(value.begin(), value.end(), value.begin(), toupper);
 
     auto supported = ThermalModeIntf::supported();
-    auto isSupported = std::any_of(supported.begin(), supported.end(),
-                                   [&value](auto& s) {
-        std::transform(s.begin(), s.end(), s.begin(), toupper);
-        return value == s;
-    });
+    auto isSupported =
+        std::any_of(supported.begin(), supported.end(), [&value](auto& s) {
+            std::transform(s.begin(), s.end(), s.begin(), toupper);
+            return value == s;
+        });
 
     if (isSupported && value != current)
     {
diff --git a/control/json/event.cpp b/control/json/event.cpp
index 628c222..0e7f1e5 100644
--- a/control/json/event.cpp
+++ b/control/json/event.cpp
@@ -40,8 +40,8 @@
 
 Event::Event(const json& jsonObj, Manager* mgr,
              std::map<configKey, std::unique_ptr<Zone>>& zones) :
-    ConfigBase(jsonObj),
-    _bus(util::SDBusPlus::getBus()), _manager(mgr), _zones(zones)
+    ConfigBase(jsonObj), _bus(util::SDBusPlus::getBus()), _manager(mgr),
+    _zones(zones)
 {
     // Event groups are optional
     if (jsonObj.contains("groups"))
@@ -155,10 +155,11 @@
 
             configKey eventProfile =
                 std::make_pair(jsonGrp["name"].get<std::string>(), profiles);
-            auto grpEntry = std::find_if(availGroups.begin(), availGroups.end(),
-                                         [&eventProfile](const auto& grp) {
-                return Manager::inConfig(grp.first, eventProfile);
-            });
+            auto grpEntry = std::find_if(
+                availGroups.begin(), availGroups.end(),
+                [&eventProfile](const auto& grp) {
+                    return Manager::inConfig(grp.first, eventProfile);
+                });
             if (grpEntry != availGroups.end())
             {
                 auto group = Group(*grpEntry->second);
@@ -188,12 +189,13 @@
             // against all zones matching the event's active profiles
             for (const auto& zone : _zones)
             {
-                configKey eventProfile = std::make_pair(zone.second->getName(),
-                                                        _profiles);
-                auto zoneEntry = std::find_if(_zones.begin(), _zones.end(),
-                                              [&eventProfile](const auto& z) {
-                    return Manager::inConfig(z.first, eventProfile);
-                });
+                configKey eventProfile =
+                    std::make_pair(zone.second->getName(), _profiles);
+                auto zoneEntry = std::find_if(
+                    _zones.begin(), _zones.end(),
+                    [&eventProfile](const auto& z) {
+                        return Manager::inConfig(z.first, eventProfile);
+                    });
                 if (zoneEntry != _zones.end())
                 {
                     actionZones.emplace_back(*zoneEntry->second);
@@ -208,10 +210,11 @@
             {
                 configKey eventProfile =
                     std::make_pair(jsonZone.get<std::string>(), _profiles);
-                auto zoneEntry = std::find_if(_zones.begin(), _zones.end(),
-                                              [&eventProfile](const auto& z) {
-                    return Manager::inConfig(z.first, eventProfile);
-                });
+                auto zoneEntry = std::find_if(
+                    _zones.begin(), _zones.end(),
+                    [&eventProfile](const auto& z) {
+                        return Manager::inConfig(z.first, eventProfile);
+                    });
                 if (zoneEntry != _zones.end())
                 {
                     actionZones.emplace_back(*zoneEntry->second);
@@ -299,8 +302,8 @@
             auto availTrigs = std::accumulate(
                 std::next(trigger::triggers.begin()), trigger::triggers.end(),
                 trigger::triggers.begin()->first, [](auto list, auto trig) {
-                return std::move(list) + ", " + trig.first;
-            });
+                    return std::move(list) + ", " + trig.first;
+                });
             log<level::ERR>(
                 std::format("Trigger '{}' is not recognized", tClass).c_str(),
                 entry("AVAILABLE_TRIGGERS=%s", availTrigs.c_str()));
@@ -314,14 +317,14 @@
     json actionData;
     std::for_each(_actions.begin(), _actions.end(),
                   [&actionData](const auto& action) {
-        actionData[action->getUniqueName()] = action->dump();
-    });
+                      actionData[action->getUniqueName()] = action->dump();
+                  });
 
     std::vector<std::string> groupData;
     std::for_each(_groups.begin(), _groups.end(),
                   [&groupData](const auto& group) {
-        groupData.push_back(group.getName());
-    });
+                      groupData.push_back(group.getName());
+                  });
 
     json eventData;
     eventData["groups"] = groupData;
diff --git a/control/json/fan.cpp b/control/json/fan.cpp
index 5abcfbe..a808003 100644
--- a/control/json/fan.cpp
+++ b/control/json/fan.cpp
@@ -155,8 +155,8 @@
         // if additional locks, re-lock at next-highest target
         if (!_lockedTargets.empty())
         {
-            itr = std::max_element(_lockedTargets.begin(),
-                                   _lockedTargets.end());
+            itr =
+                std::max_element(_lockedTargets.begin(), _lockedTargets.end());
 
             // setTarget wont work if any locked targets exist
             decltype(_lockedTargets) temp;
diff --git a/control/json/manager.cpp b/control/json/manager.cpp
index 0161304..6ae51c9 100644
--- a/control/json/manager.cpp
+++ b/control/json/manager.cpp
@@ -168,12 +168,12 @@
         auto fans = getConfig<Fan>(false);
         for (auto& fan : fans)
         {
-            configKey fanProfile = std::make_pair(fan.second->getZone(),
-                                                  fan.first.second);
-            auto itZone = std::find_if(zones.begin(), zones.end(),
-                                       [&fanProfile](const auto& zone) {
-                return Manager::inConfig(fanProfile, zone.first);
-            });
+            configKey fanProfile =
+                std::make_pair(fan.second->getZone(), fan.first.second);
+            auto itZone = std::find_if(
+                zones.begin(), zones.end(), [&fanProfile](const auto& zone) {
+                    return Manager::inConfig(fanProfile, zone.first);
+                });
             if (itZone != zones.end())
             {
                 if (itZone->second->getTarget() != fan.second->getTarget() &&
@@ -273,19 +273,21 @@
     {
         // Profiles must have one match in the other's profiles(and they must be
         // an active profile) to be used in the config
-        return std::any_of(input.second.begin(), input.second.end(),
-                           [&comp](const auto& lProfile) {
-            return std::any_of(comp.second.begin(), comp.second.end(),
-                               [&lProfile](const auto& rProfile) {
-                if (lProfile != rProfile)
-                {
-                    return false;
-                }
-                auto activeProfs = getActiveProfiles();
-                return std::find(activeProfs.begin(), activeProfs.end(),
-                                 lProfile) != activeProfs.end();
+        return std::any_of(
+            input.second.begin(), input.second.end(),
+            [&comp](const auto& lProfile) {
+                return std::any_of(
+                    comp.second.begin(), comp.second.end(),
+                    [&lProfile](const auto& rProfile) {
+                        if (lProfile != rProfile)
+                        {
+                            return false;
+                        }
+                        auto activeProfs = getActiveProfiles();
+                        return std::find(activeProfs.begin(), activeProfs.end(),
+                                         lProfile) != activeProfs.end();
+                    });
             });
-        });
     }
 }
 
@@ -416,8 +418,8 @@
                 if (servIter != pathIter->second.end())
                 {
                     if (std::find(servIter->second.second.begin(),
-                                  servIter->second.second.end(),
-                                  intf) == servIter->second.second.end())
+                                  servIter->second.second.end(), intf) ==
+                        servIter->second.second.end())
                     {
                         // Add interface to cache
                         servIter->second.second.emplace_back(intf);
@@ -427,8 +429,8 @@
                 {
                     // Service not found in cache
                     auto intfs = {intf};
-                    pathIter->second[itServ.first] = std::make_pair(true,
-                                                                    intfs);
+                    pathIter->second[itServ.first] =
+                        std::make_pair(true, intfs);
                 }
             }
         }
@@ -458,8 +460,8 @@
     return serviceName;
 }
 
-std::vector<std::string> Manager::findPaths(const std::string& serv,
-                                            const std::string& intf)
+std::vector<std::string>
+    Manager::findPaths(const std::string& serv, const std::string& intf)
 {
     std::vector<std::string> paths;
 
@@ -469,8 +471,8 @@
         if (itServ != path.second.end())
         {
             if (std::find(itServ->second.second.begin(),
-                          itServ->second.second.end(),
-                          intf) != itServ->second.second.end())
+                          itServ->second.second.end(), intf) !=
+                itServ->second.second.end())
             {
                 if (std::find(paths.begin(), paths.end(), path.first) ==
                     paths.end())
@@ -598,9 +600,8 @@
     }
 }
 
-const std::optional<PropertyVariantType>
-    Manager::getProperty(const std::string& path, const std::string& intf,
-                         const std::string& prop)
+const std::optional<PropertyVariantType> Manager::getProperty(
+    const std::string& path, const std::string& intf, const std::string& prop)
 {
     // TODO Objects hosted by fan control (i.e. ThermalMode) are required to
     // update the cache upon being set/updated
@@ -691,11 +692,11 @@
 
                     // Look for the ObjectManager as an ancestor from the
                     // member.
-                    auto hasObjMgr = std::any_of(objMgrPaths.begin(),
-                                                 objMgrPaths.end(),
-                                                 [&member](const auto& path) {
-                        return member.find(path) != std::string::npos;
-                    });
+                    auto hasObjMgr = std::any_of(
+                        objMgrPaths.begin(), objMgrPaths.end(),
+                        [&member](const auto& path) {
+                            return member.find(path) != std::string::npos;
+                        });
 
                     if (!hasObjMgr)
                     {
@@ -756,12 +757,12 @@
     // Remove oneshot timers after they expired
     if (data.first == TimerType::oneshot)
     {
-        auto itTimer = std::find_if(_timers.begin(), _timers.end(),
-                                    [&data](const auto& timer) {
-            return (data.first == timer.first->first &&
-                    (std::get<std::string>(data.second) ==
-                     std::get<std::string>(timer.first->second)));
-        });
+        auto itTimer = std::find_if(
+            _timers.begin(), _timers.end(), [&data](const auto& timer) {
+                return (data.first == timer.first->first &&
+                        (std::get<std::string>(data.second) ==
+                         std::get<std::string>(timer.first->second)));
+            });
         if (itTimer != std::end(_timers))
         {
             _timers.erase(itTimer);
@@ -776,8 +777,8 @@
     {
         // Handle the signal callback and only run the actions if the handler
         // updated the cache for the given SignalObject
-        if (std::get<SignalHandler>(pkg)(msg, std::get<SignalObject>(pkg),
-                                         *this))
+        if (std::get<SignalHandler>(
+                pkg)(msg, std::get<SignalObject>(pkg), *this))
         {
             // Perform the actions in the handler package
             auto& actions = std::get<TriggerActions>(pkg);
@@ -799,8 +800,8 @@
 void Manager::setProfiles()
 {
     // Profiles JSON config file is optional
-    auto confFile = fan::JsonConfig::getConfFile(confAppName,
-                                                 Profile::confFileName, true);
+    auto confFile =
+        fan::JsonConfig::getConfFile(confAppName, Profile::confFileName, true);
 
     _profiles.clear();
     if (!confFile.empty())
@@ -834,16 +835,16 @@
     {
         std::for_each(actions.begin(), actions.end(),
                       [&actList = it->second](auto& action) {
-            actList.emplace_back(std::ref(action));
-        });
+                          actList.emplace_back(std::ref(action));
+                      });
     }
     else
     {
         TriggerActions triggerActions;
         std::for_each(actions.begin(), actions.end(),
                       [&triggerActions](auto& action) {
-            triggerActions.emplace_back(std::ref(action));
-        });
+                          triggerActions.emplace_back(std::ref(action));
+                      });
         _parameterTriggers[name] = std::move(triggerActions);
     }
 }
diff --git a/control/json/manager.hpp b/control/json/manager.hpp
index d7657e9..2f66181 100644
--- a/control/json/manager.hpp
+++ b/control/json/manager.hpp
@@ -198,8 +198,8 @@
      *     Map of configuration keys to their corresponding configuration object
      */
     template <typename T, typename... Args>
-    static std::map<configKey, std::unique_ptr<T>> getConfig(bool isOptional,
-                                                             Args&&... args)
+    static std::map<configKey, std::unique_ptr<T>>
+        getConfig(bool isOptional, Args&&... args)
     {
         std::map<configKey, std::unique_ptr<T>> config;
 
@@ -226,16 +226,18 @@
                     if (!profiles.empty() &&
                         !std::any_of(profiles.begin(), profiles.end(),
                                      [](const auto& name) {
-                        return std::find(getActiveProfiles().begin(),
-                                         getActiveProfiles().end(),
-                                         name) != getActiveProfiles().end();
-                    }))
+                                         return std::find(
+                                                    getActiveProfiles().begin(),
+                                                    getActiveProfiles().end(),
+                                                    name) !=
+                                                getActiveProfiles().end();
+                                     }))
                     {
                         continue;
                     }
                 }
-                auto obj = std::make_unique<T>(entry,
-                                               std::forward<Args>(args)...);
+                auto obj =
+                    std::make_unique<T>(entry, std::forward<Args>(args)...);
                 config.emplace(
                     std::make_pair(obj->getName(), obj->getProfiles()),
                     std::move(obj));
diff --git a/control/json/profile.cpp b/control/json/profile.cpp
index 7cb818b..0778820 100644
--- a/control/json/profile.cpp
+++ b/control/json/profile.cpp
@@ -60,11 +60,11 @@
     else
     {
         // Construct list of available methods
-        auto methods = std::accumulate(std::next(_methods.begin()),
-                                       _methods.end(), _methods.begin()->first,
-                                       [](auto list, auto method) {
-            return std::move(list) + ", " + method.first;
-        });
+        auto methods = std::accumulate(
+            std::next(_methods.begin()), _methods.end(),
+            _methods.begin()->first, [](auto list, auto method) {
+                return std::move(list) + ", " + method.first;
+            });
         log<level::ERR>("Configured method not available",
                         entry("JSON=%s", jsonObj["method"].dump().c_str()),
                         entry("METHODS_AVAILABLE=%s", methods.c_str()));
@@ -81,23 +81,26 @@
             "Missing required all_of method properties list");
     }
 
-    return std::all_of(method["properties"].begin(), method["properties"].end(),
-                       [](const json& obj) {
-        if (!obj.contains("path") || !obj.contains("interface") ||
-            !obj.contains("property") || !obj.contains("value"))
-        {
-            log<level::ERR>(
-                "Missing required all_of method property parameters",
-                entry("JSON=%s", obj.dump().c_str()));
-            throw std::runtime_error(
-                "Missing required all_of method parameters");
-        }
-        auto variant = util::SDBusPlus::getPropertyVariant<PropertyVariantType>(
-            obj["path"].get<std::string>(), obj["interface"].get<std::string>(),
-            obj["property"].get<std::string>());
+    return std::all_of(
+        method["properties"].begin(), method["properties"].end(),
+        [](const json& obj) {
+            if (!obj.contains("path") || !obj.contains("interface") ||
+                !obj.contains("property") || !obj.contains("value"))
+            {
+                log<level::ERR>(
+                    "Missing required all_of method property parameters",
+                    entry("JSON=%s", obj.dump().c_str()));
+                throw std::runtime_error(
+                    "Missing required all_of method parameters");
+            }
+            auto variant =
+                util::SDBusPlus::getPropertyVariant<PropertyVariantType>(
+                    obj["path"].get<std::string>(),
+                    obj["interface"].get<std::string>(),
+                    obj["property"].get<std::string>());
 
-        return getJsonValue(obj["value"]) == variant;
-    });
+            return getJsonValue(obj["value"]) == variant;
+        });
 }
 
 } // namespace phosphor::fan::control::json
diff --git a/control/json/triggers/handlers.hpp b/control/json/triggers/handlers.hpp
index 8e8595f..a263295 100644
--- a/control/json/triggers/handlers.hpp
+++ b/control/json/triggers/handlers.hpp
@@ -112,8 +112,8 @@
 
         std::vector<std::string> intfs;
         msg.read(intfs);
-        auto itIntf = std::find(intfs.begin(), intfs.end(),
-                                std::get<Intf>(obj));
+        auto itIntf =
+            std::find(intfs.begin(), intfs.end(), std::get<Intf>(obj));
         if (itIntf == intfs.cend())
         {
             // Object's interface not in list of interfaces removed
diff --git a/control/json/triggers/init.cpp b/control/json/triggers/init.cpp
index bd557d7..3d9a535 100644
--- a/control/json/triggers/init.cpp
+++ b/control/json/triggers/init.cpp
@@ -162,8 +162,8 @@
             auto availMethods = std::accumulate(
                 std::next(methods.begin()), methods.end(),
                 methods.begin()->first, [](auto list, auto method) {
-                return std::move(list) + ", " + method.first;
-            });
+                    return std::move(list) + ", " + method.first;
+                });
             auto msg =
                 std::format("Event '{}' requires a supported method given to "
                             "be init driven, available methods: {}",
diff --git a/control/json/triggers/signal.cpp b/control/json/triggers/signal.cpp
index 537ef50..c0641d9 100644
--- a/control/json/triggers/signal.cpp
+++ b/control/json/triggers/signal.cpp
@@ -100,13 +100,13 @@
     {
         // Setup property changed signal handler on the group member's
         // property
-        const auto match = rules::propertiesChanged(member,
-                                                    group.getInterface());
-        SignalPkg signalPkg = {Handlers::propertiesChanged,
-                               SignalObject(std::cref(member),
-                                            std::cref(group.getInterface()),
-                                            std::cref(group.getProperty())),
-                               actions};
+        const auto match =
+            rules::propertiesChanged(member, group.getInterface());
+        SignalPkg signalPkg = {
+            Handlers::propertiesChanged,
+            SignalObject(std::cref(member), std::cref(group.getInterface()),
+                         std::cref(group.getProperty())),
+            actions};
         auto isSameSig = [&prop = group.getProperty()](SignalPkg& pkg) {
             auto& obj = std::get<SignalObject>(pkg);
             return prop == std::get<Prop>(obj);
@@ -124,13 +124,13 @@
     for (const auto& member : group.getMembers())
     {
         // Setup interfaces added signal handler on the group member
-        const auto match = rules::interfacesAdded() +
-                           rules::argNpath(0, member);
-        SignalPkg signalPkg = {Handlers::interfacesAdded,
-                               SignalObject(std::cref(member),
-                                            std::cref(group.getInterface()),
-                                            std::cref(group.getProperty())),
-                               actions};
+        const auto match =
+            rules::interfacesAdded() + rules::argNpath(0, member);
+        SignalPkg signalPkg = {
+            Handlers::interfacesAdded,
+            SignalObject(std::cref(member), std::cref(group.getInterface()),
+                         std::cref(group.getProperty())),
+            actions};
         auto isSameSig = [&intf = group.getInterface()](SignalPkg& pkg) {
             auto& obj = std::get<SignalObject>(pkg);
             return intf == std::get<Intf>(obj);
@@ -148,13 +148,13 @@
     for (const auto& member : group.getMembers())
     {
         // Setup interfaces removed signal handler on the group member
-        const auto match = rules::interfacesRemoved() +
-                           rules::argNpath(0, member);
-        SignalPkg signalPkg = {Handlers::interfacesRemoved,
-                               SignalObject(std::cref(member),
-                                            std::cref(group.getInterface()),
-                                            std::cref(group.getProperty())),
-                               actions};
+        const auto match =
+            rules::interfacesRemoved() + rules::argNpath(0, member);
+        SignalPkg signalPkg = {
+            Handlers::interfacesRemoved,
+            SignalObject(std::cref(member), std::cref(group.getInterface()),
+                         std::cref(group.getProperty())),
+            actions};
         auto isSameSig = [&intf = group.getInterface()](SignalPkg& pkg) {
             auto& obj = std::get<SignalObject>(pkg);
             return intf == std::get<Intf>(obj);
@@ -252,8 +252,8 @@
         auto availSignals =
             std::accumulate(std::next(signals.begin()), signals.end(),
                             signals.begin()->first, [](auto list, auto signal) {
-            return std::move(list) + ", " + signal.first;
-        });
+                                return std::move(list) + ", " + signal.first;
+                            });
         auto msg =
             std::format("Event '{}' requires a supported signal given to be "
                         "triggered by signal, available signals: {}",
@@ -269,8 +269,8 @@
         TriggerActions signalActions;
         std::for_each(actions.begin(), actions.end(),
                       [&signalActions](auto& action) {
-            signalActions.emplace_back(std::ref(action));
-        });
+                          signalActions.emplace_back(std::ref(action));
+                      });
         for (const auto& group : groups)
         {
             // Call signal subscriber for each group
diff --git a/control/json/utils/flight_recorder.cpp b/control/json/utils/flight_recorder.cpp
index 00325f5..b26d2d8 100644
--- a/control/json/utils/flight_recorder.cpp
+++ b/control/json/utils/flight_recorder.cpp
@@ -70,8 +70,8 @@
 
     std::sort(output.begin(), output.end(),
               [](const auto& left, const auto& right) {
-        return std::get<Timepoint>(left) < std::get<Timepoint>(right);
-    });
+                  return std::get<Timepoint>(left) < std::get<Timepoint>(right);
+              });
 
     auto formatTime = [](const Timepoint& tp) {
         std::stringstream ss;
diff --git a/control/json/utils/pcie_card_metadata.cpp b/control/json/utils/pcie_card_metadata.cpp
index ec6452c..c8c1b37 100644
--- a/control/json/utils/pcie_card_metadata.cpp
+++ b/control/json/utils/pcie_card_metadata.cpp
@@ -112,10 +112,10 @@
         }
 
         Metadata data;
-        data.vendorID = std::stoul(card.at("vendor_id").get<std::string>(),
-                                   nullptr, 16);
-        data.deviceID = std::stoul(card.at("device_id").get<std::string>(),
-                                   nullptr, 16);
+        data.vendorID =
+            std::stoul(card.at("vendor_id").get<std::string>(), nullptr, 16);
+        data.deviceID =
+            std::stoul(card.at("device_id").get<std::string>(), nullptr, 16);
         data.subsystemVendorID = std::stoul(
             card.at("subsystem_vendor_id").get<std::string>(), nullptr, 16);
         data.subsystemID =
@@ -157,21 +157,21 @@
     }
 }
 
-std::optional<std::variant<int32_t, bool>>
-    PCIeCardMetadata::lookup(uint16_t deviceID, uint16_t vendorID,
-                             uint16_t subsystemID,
-                             uint16_t subsystemVendorID) const
+std::optional<std::variant<int32_t, bool>> PCIeCardMetadata::lookup(
+    uint16_t deviceID, uint16_t vendorID, uint16_t subsystemID,
+    uint16_t subsystemVendorID) const
 {
     log<level::DEBUG>(std::format("Lookup {:#x} ${:#x} {:#x} {:#x}", deviceID,
                                   vendorID, subsystemID, subsystemVendorID)
                           .c_str());
-    auto card = std::find_if(_cards.begin(), _cards.end(),
-                             [&deviceID, &vendorID, &subsystemID,
-                              &subsystemVendorID](const auto& card) {
-        return (deviceID == card.deviceID) && (vendorID == card.vendorID) &&
-               (subsystemID == card.subsystemID) &&
-               (subsystemVendorID == card.subsystemVendorID);
-    });
+    auto card = std::find_if(
+        _cards.begin(), _cards.end(),
+        [&deviceID, &vendorID, &subsystemID,
+         &subsystemVendorID](const auto& card) {
+            return (deviceID == card.deviceID) && (vendorID == card.vendorID) &&
+                   (subsystemID == card.subsystemID) &&
+                   (subsystemVendorID == card.subsystemVendorID);
+        });
 
     if (card != _cards.end())
     {
diff --git a/control/json/zone.cpp b/control/json/zone.cpp
index 12f8c02..8dc6044 100644
--- a/control/json/zone.cpp
+++ b/control/json/zone.cpp
@@ -161,9 +161,10 @@
 
 void Zone::lockFanTarget(const std::string& fname, uint64_t target)
 {
-    auto fanItr = std::find_if(
-        _fans.begin(), _fans.end(),
-        [&fname](const auto& fan) { return fan->getName() == fname; });
+    auto fanItr =
+        std::find_if(_fans.begin(), _fans.end(), [&fname](const auto& fan) {
+            return fan->getName() == fname;
+        });
 
     if (_fans.end() != fanItr)
     {
@@ -180,9 +181,10 @@
 
 void Zone::unlockFanTarget(const std::string& fname, uint64_t target)
 {
-    auto fanItr = std::find_if(
-        _fans.begin(), _fans.end(),
-        [&fname](const auto& fan) { return fan->getName() == fname; });
+    auto fanItr =
+        std::find_if(_fans.begin(), _fans.end(), [&fname](const auto& fan) {
+            return fan->getName() == fname;
+        });
 
     if (_fans.end() != fanItr)
     {
@@ -230,8 +232,8 @@
 
     auto itHoldMax = std::max_element(_targetHolds.begin(), _targetHolds.end(),
                                       [](const auto& aHold, const auto& bHold) {
-        return aHold.second < bHold.second;
-    });
+                                          return aHold.second < bHold.second;
+                                      });
     if (itHoldMax == _targetHolds.end())
     {
         _isActive = true;
@@ -293,8 +295,8 @@
 
     auto itHoldMax = std::max_element(_floorHolds.begin(), _floorHolds.end(),
                                       [](const auto& aHold, const auto& bHold) {
-        return aHold.second < bHold.second;
-    });
+                                          return aHold.second < bHold.second;
+                                      });
     if (itHoldMax == _floorHolds.end())
     {
         if (_floor != _defaultFloor)
@@ -461,8 +463,8 @@
             auto intfs = std::accumulate(
                 std::next(_intfPropHandlers.begin()), _intfPropHandlers.end(),
                 _intfPropHandlers.begin()->first, [](auto list, auto intf) {
-                return std::move(list) + ", " + intf.first;
-            });
+                    return std::move(list) + ", " + intf.first;
+                });
             log<level::ERR>("Configured interface not available",
                             entry("JSON=%s", interface.dump().c_str()),
                             entry("AVAILABLE_INTFS=%s", intfs.c_str()));
@@ -496,8 +498,8 @@
                     std::next(propFuncs->second.begin()),
                     propFuncs->second.end(), propFuncs->second.begin()->first,
                     [](auto list, auto prop) {
-                    return std::move(list) + ", " + prop.first;
-                });
+                        return std::move(list) + ", " + prop.first;
+                    });
                 log<level::ERR>("Configured property not available",
                                 entry("JSON=%s", property.dump().c_str()),
                                 entry("AVAILABLE_PROPS=%s", props.c_str()));
@@ -556,8 +558,8 @@
 {
 // Get a set property handler function for the configured values of the
 // "Supported" property
-std::function<void(DBusZone&, Zone&)> supported(const json& jsonObj,
-                                                bool persist)
+std::function<void(DBusZone&, Zone&)>
+    supported(const json& jsonObj, bool persist)
 {
     std::vector<std::string> values;
     if (!jsonObj.contains("values"))
diff --git a/control/json/zone.hpp b/control/json/zone.hpp
index 21fccbc..bb00416 100644
--- a/control/json/zone.hpp
+++ b/control/json/zone.hpp
@@ -381,8 +381,8 @@
     static auto setProperty(const char* intf, const char* prop,
                             T (DBusZone::*func)(T), T&& value, bool persist)
     {
-        return [=, value = std::forward<T>(value)](DBusZone& dbusZone,
-                                                   Zone& zone) {
+        return [=, value =
+                       std::forward<T>(value)](DBusZone& dbusZone, Zone& zone) {
             (dbusZone.*func)(value);
             if (persist)
             {
@@ -551,8 +551,8 @@
  *
  * @return Zone dbus object's set property function for the "Supported" property
  */
-std::function<void(DBusZone&, Zone&)> supported(const json& jsonObj,
-                                                bool persist);
+std::function<void(DBusZone&, Zone&)>
+    supported(const json& jsonObj, bool persist);
 
 /**
  * @brief "Current" property on the "xyz.openbmc_project.Control.ThermalMode"
@@ -564,8 +564,8 @@
  *
  * @return Zone dbus object's set property function for the "Current" property
  */
-std::function<void(DBusZone&, Zone&)> current(const json& jsonObj,
-                                              bool persist);
+std::function<void(DBusZone&, Zone&)>
+    current(const json& jsonObj, bool persist);
 
 } // namespace zone::property
 
diff --git a/control/main.cpp b/control/main.cpp
index e28e947..9286dc7 100644
--- a/control/main.cpp
+++ b/control/main.cpp
@@ -90,8 +90,8 @@
     try
     {
 #ifdef CONTROL_USE_JSON
-        phosphor::fan::control::json::FlightRecorder::instance().log("main",
-                                                                     "Startup");
+        phosphor::fan::control::json::FlightRecorder::instance().log(
+            "main", "Startup");
         json::Manager manager(event);
 
         // Handle loading fan control's config file(s)
diff --git a/control/manager.cpp b/control/manager.cpp
index 27c3b47..abcad6f 100644
--- a/control/manager.cpp
+++ b/control/manager.cpp
@@ -83,9 +83,7 @@
 
 // Note: Future code will check 'mode' before starting control algorithm
 Manager::Manager(sdbusplus::bus_t& bus, const sdeventplus::Event& event,
-                 Mode mode) :
-    _bus(bus),
-    _objMgr(bus, CONTROL_OBJPATH)
+                 Mode mode) : _bus(bus), _objMgr(bus, CONTROL_OBJPATH)
 {
     // Create the appropriate Zone objects based on the
     // actual system configuration.
@@ -97,8 +95,8 @@
 
         if (std::all_of(conditions.begin(), conditions.end(),
                         [&bus](const auto& condition) {
-            return checkCondition(bus, condition);
-        }))
+                            return checkCondition(bus, condition);
+                        }))
         {
             // Create a Zone object for each zone in this group
             auto& zones = std::get<zoneListPos>(group);
diff --git a/control/preconditions.cpp b/control/preconditions.cpp
index 6365d41..13f51db 100644
--- a/control/preconditions.cpp
+++ b/control/preconditions.cpp
@@ -23,21 +23,22 @@
 {
     return [pg = std::move(pg), sse = std::move(sse)](auto& zone, auto& group) {
         // Compare given precondition entries
-        auto precondState = std::all_of(pg.begin(), pg.end(),
-                                        [&zone](auto const& entry) {
-            try
-            {
-                return zone.getPropValueVariant(std::get<pcPathPos>(entry),
-                                                std::get<pcIntfPos>(entry),
-                                                std::get<pcPropPos>(entry)) ==
-                       std::get<pcValuePos>(entry);
-            }
-            catch (const std::out_of_range& oore)
-            {
-                // Default to property variants not equal when not found
-                return false;
-            }
-        });
+        auto precondState =
+            std::all_of(pg.begin(), pg.end(), [&zone](const auto& entry) {
+                try
+                {
+                    return zone.getPropValueVariant(
+                               std::get<pcPathPos>(entry),
+                               std::get<pcIntfPos>(entry),
+                               std::get<pcPropPos>(entry)) ==
+                           std::get<pcValuePos>(entry);
+                }
+                catch (const std::out_of_range& oore)
+                {
+                    // Default to property variants not equal when not found
+                    return false;
+                }
+            });
 
         if (precondState)
         {
@@ -45,7 +46,7 @@
                 "Preconditions passed, init the associated events",
                 entry("EVENT_COUNT=%u", sse.size()));
             // Init the events when all the precondition(s) are true
-            std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+            std::for_each(sse.begin(), sse.end(), [&zone](const auto& entry) {
                 zone.initEvent(entry);
             });
         }
@@ -55,7 +56,7 @@
                 "Preconditions not met for events, events removed if present",
                 entry("EVENT_COUNT=%u", sse.size()));
             // Unsubscribe the events' signals when any precondition is false
-            std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+            std::for_each(sse.begin(), sse.end(), [&zone](const auto& entry) {
                 zone.removeEvent(entry);
             });
             zone.setFullSpeed();
@@ -71,21 +72,22 @@
         // Set/update the services of the group
         zone.setServices(&group);
         const auto& services = zone.getGroupServices(&group);
-        auto precondState = std::any_of(
-            services.begin(), services.end(),
-            [](const auto& s) { return !std::get<hasOwnerPos>(s); });
+        auto precondState =
+            std::any_of(services.begin(), services.end(), [](const auto& s) {
+                return !std::get<hasOwnerPos>(s);
+            });
 
         if (precondState)
         {
             // Init the events when all the precondition(s) are true
-            std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+            std::for_each(sse.begin(), sse.end(), [&zone](const auto& entry) {
                 zone.initEvent(entry);
             });
         }
         else
         {
             // Unsubscribe the events' signals when any precondition is false
-            std::for_each(sse.begin(), sse.end(), [&zone](auto const& entry) {
+            std::for_each(sse.begin(), sse.end(), [&zone](const auto& entry) {
                 zone.removeEvent(entry);
             });
         }
diff --git a/control/triggers.cpp b/control/triggers.cpp
index 362f4b6..0096deb 100644
--- a/control/triggers.cpp
+++ b/control/triggers.cpp
@@ -74,9 +74,10 @@
         }
 
         // Run action functions for initial event state
-        std::for_each(
-            actions.begin(), actions.end(),
-            [&zone, &group](auto const& action) { action(zone, group); });
+        std::for_each(actions.begin(), actions.end(),
+                      [&zone, &group](const auto& action) {
+                          action(zone, group);
+                      });
     };
 }
 
diff --git a/control/zone.cpp b/control/zone.cpp
index b1badc1..6031d53 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -144,8 +144,8 @@
         auto& sNames = _services.at(*group);
         auto it = std::find_if(sNames.begin(), sNames.end(),
                                [&name](const auto& entry) {
-            return name == std::get<namePos>(entry);
-        });
+                                   return name == std::get<namePos>(entry);
+                               });
         if (it != std::end(sNames))
         {
             // Remove service name from group
@@ -166,8 +166,8 @@
         auto& sNames = _services.at(*group);
         auto it = std::find_if(sNames.begin(), sNames.end(),
                                [&name](const auto& entry) {
-            return name == std::get<namePos>(entry);
-        });
+                                   return name == std::get<namePos>(entry);
+                               });
         if (it != std::end(sNames))
         {
             std::get<hasOwnerPos>(*it) = hasOwner;
@@ -299,35 +299,36 @@
 void Zone::initEvent(const SetSpeedEvent& event)
 {
     // Enable event triggers
-    std::for_each(std::get<triggerPos>(event).begin(),
-                  std::get<triggerPos>(event).end(),
-                  [this, &event](const auto& trigger) {
-        if (!std::get<actionsPos>(event).empty())
-        {
-            std::for_each(std::get<actionsPos>(event).begin(),
-                          std::get<actionsPos>(event).end(),
-                          [this, &trigger, &event](auto const& action) {
-                // Default to use group defined with action if exists
-                if (!std::get<adGroupPos>(action).empty())
-                {
-                    trigger(*this, std::get<sseNamePos>(event),
-                            std::get<adGroupPos>(action),
-                            std::get<adActionsPos>(action));
-                }
-                else
-                {
-                    trigger(*this, std::get<sseNamePos>(event),
-                            std::get<groupPos>(event),
-                            std::get<adActionsPos>(action));
-                }
-            });
-        }
-        else
-        {
-            trigger(*this, std::get<sseNamePos>(event),
-                    std::get<groupPos>(event), {});
-        }
-    });
+    std::for_each(
+        std::get<triggerPos>(event).begin(), std::get<triggerPos>(event).end(),
+        [this, &event](const auto& trigger) {
+            if (!std::get<actionsPos>(event).empty())
+            {
+                std::for_each(
+                    std::get<actionsPos>(event).begin(),
+                    std::get<actionsPos>(event).end(),
+                    [this, &trigger, &event](const auto& action) {
+                        // Default to use group defined with action if exists
+                        if (!std::get<adGroupPos>(action).empty())
+                        {
+                            trigger(*this, std::get<sseNamePos>(event),
+                                    std::get<adGroupPos>(action),
+                                    std::get<adActionsPos>(action));
+                        }
+                        else
+                        {
+                            trigger(*this, std::get<sseNamePos>(event),
+                                    std::get<groupPos>(event),
+                                    std::get<adActionsPos>(action));
+                        }
+                    });
+            }
+            else
+            {
+                trigger(*this, std::get<sseNamePos>(event),
+                        std::get<groupPos>(event), {});
+            }
+        });
 }
 
 void Zone::removeEvent(const SetSpeedEvent& event)
@@ -352,10 +353,9 @@
     }
 }
 
-std::vector<TimerEvent>::iterator
-    Zone::findTimer(const Group& eventGroup,
-                    const std::vector<Action>& eventActions,
-                    std::vector<TimerEvent>& eventTimers)
+std::vector<TimerEvent>::iterator Zone::findTimer(
+    const Group& eventGroup, const std::vector<Action>& eventActions,
+    std::vector<TimerEvent>& eventTimers)
 {
     for (auto it = eventTimers.begin(); it != eventTimers.end(); ++it)
     {
@@ -409,9 +409,10 @@
                         const std::vector<Action>& eventActions)
 {
     // Perform the actions
-    std::for_each(
-        eventActions.begin(), eventActions.end(),
-        [this, &eventGroup](const auto& action) { action(*this, eventGroup); });
+    std::for_each(eventActions.begin(), eventActions.end(),
+                  [this, &eventGroup](const auto& action) {
+                      action(*this, eventGroup);
+                  });
 }
 
 void Zone::handleEvent(sdbusplus::message_t& msg, const EventData* eventData)
@@ -422,8 +423,8 @@
     std::for_each(std::get<eventActionsPos>(*eventData).begin(),
                   std::get<eventActionsPos>(*eventData).end(),
                   [this, &eventData](const auto& action) {
-        action(*this, std::get<eventGroupPos>(*eventData));
-    });
+                      action(*this, std::get<eventGroupPos>(*eventData));
+                  });
 }
 
 const std::string& Zone::getService(const std::string& path,
@@ -478,8 +479,8 @@
                     for (auto& iIter : sIter.second)
                     {
                         if (std::find(servIter->second.begin(),
-                                      servIter->second.end(),
-                                      iIter) == servIter->second.end())
+                                      servIter->second.end(), iIter) ==
+                            servIter->second.end())
                         {
                             // Add interface to cache
                             servIter->second.emplace_back(iIter);
@@ -533,11 +534,11 @@
     std::transform(value.begin(), value.end(), value.begin(), toupper);
 
     auto supported = ThermalObject::supported();
-    auto isSupported = std::any_of(supported.begin(), supported.end(),
-                                   [&value](auto& s) {
-        std::transform(s.begin(), s.end(), s.begin(), toupper);
-        return value == s;
-    });
+    auto isSupported =
+        std::any_of(supported.begin(), supported.end(), [&value](auto& s) {
+            std::transform(s.begin(), s.end(), s.begin(), toupper);
+            return value == s;
+        });
 
     if (value != current && isSupported)
     {
diff --git a/control/zone.hpp b/control/zone.hpp
index ce9c6bf..dfa6efb 100644
--- a/control/zone.hpp
+++ b/control/zone.hpp
@@ -241,24 +241,24 @@
             std::optional<T> value;
             std::visit(
                 [&value](auto&& val) {
-                // If the type configured is int64, but the sensor value
-                // property's type is double, scale it by 1000 and return
-                // the value as an int64 as configured.
-                using V = std::decay_t<decltype(val)>;
-                if constexpr (std::is_same_v<T, int64_t> &&
-                              std::is_same_v<V, double>)
-                {
-                    val = val * 1000;
-                    value = std::lround(val);
-                }
-                // If the type configured matches the sensor value
-                // property's type, just return the value as its
-                // given type.
-                else if constexpr (std::is_same_v<T, V>)
-                {
-                    value = val;
-                }
-            },
+                    // If the type configured is int64, but the sensor value
+                    // property's type is double, scale it by 1000 and return
+                    // the value as an int64 as configured.
+                    using V = std::decay_t<decltype(val)>;
+                    if constexpr (std::is_same_v<T, int64_t> &&
+                                  std::is_same_v<V, double>)
+                    {
+                        val = val * 1000;
+                        value = std::lround(val);
+                    }
+                    // If the type configured matches the sensor value
+                    // property's type, just return the value as its
+                    // given type.
+                    else if constexpr (std::is_same_v<T, V>)
+                    {
+                        value = val;
+                    }
+                },
                 variant);
 
             // Unable to return Sensor Value property
@@ -504,10 +504,9 @@
      *
      * @return - Iterator to the timer event
      */
-    std::vector<TimerEvent>::iterator
-        findTimer(const Group& eventGroup,
-                  const std::vector<Action>& eventActions,
-                  std::vector<TimerEvent>& eventTimers);
+    std::vector<TimerEvent>::iterator findTimer(
+        const Group& eventGroup, const std::vector<Action>& eventActions,
+        std::vector<TimerEvent>& eventTimers);
 
     /**
      * @brief Add a timer to the list of timer based events
@@ -628,12 +627,12 @@
                     // type(T) is available on this interface and read it
                     std::visit(
                         [&value](auto&& val) {
-                        using V = std::decay_t<decltype(val)>;
-                        if constexpr (std::is_same_v<T, V>)
-                        {
-                            value = val;
-                        }
-                    },
+                            using V = std::decay_t<decltype(val)>;
+                            if constexpr (std::is_same_v<T, V>)
+                            {
+                                value = val;
+                            }
+                        },
                         var);
 
                     return value;
diff --git a/cooling-type/cooling_type.cpp b/cooling-type/cooling_type.cpp
index 2df84bd..3b83bec 100644
--- a/cooling-type/cooling_type.cpp
+++ b/cooling-type/cooling_type.cpp
@@ -65,8 +65,8 @@
     auto gpioDev = evdevOpen(gpioFd());
 
     int value = 0;
-    auto fetch_rc = libevdev_fetch_event_value(gpioDev.get(), EV_KEY, keycode,
-                                               &value);
+    auto fetch_rc =
+        libevdev_fetch_event_value(gpioDev.get(), EV_KEY, keycode, &value);
     if (0 == fetch_rc)
     {
         log<level::ERR>(
diff --git a/cooling-type/main.cpp b/cooling-type/main.cpp
index 2c31757..402e632 100644
--- a/cooling-type/main.cpp
+++ b/cooling-type/main.cpp
@@ -82,14 +82,14 @@
     }
     catch (const DBusMethodError& dme)
     {
-        log<level::ERR>(std::format("Uncaught DBus method failure exception "
-                                    "Busname: {} "
-                                    "Path: {} "
-                                    "Interface: {} "
-                                    "Method: {}",
-                                    dme.busName, dme.path, dme.interface,
-                                    dme.method)
-                            .c_str());
+        log<level::ERR>(
+            std::format("Uncaught DBus method failure exception "
+                        "Busname: {} "
+                        "Path: {} "
+                        "Interface: {} "
+                        "Method: {}",
+                        dme.busName, dme.path, dme.interface, dme.method)
+                .c_str());
     }
     catch (const std::exception& err)
     {
diff --git a/json_config.hpp b/json_config.hpp
index 04deb6b..52dd505 100644
--- a/json_config.hpp
+++ b/json_config.hpp
@@ -263,13 +263,13 @@
 
         // Look for a config file at each entry relative to the base
         // path and use the first one found
-        auto it =
-            std::find_if(_confCompatValues.begin(), _confCompatValues.end(),
-                         [&confFile, &appName, &fileName](const auto& value) {
-            confFile = fs::path{confBasePath} / appName / value / fileName;
-            _compatibleName = value;
-            return fs::exists(confFile);
-        });
+        auto it = std::find_if(
+            _confCompatValues.begin(), _confCompatValues.end(),
+            [&confFile, &appName, &fileName](const auto& value) {
+                confFile = fs::path{confBasePath} / appName / value / fileName;
+                _compatibleName = value;
+                return fs::exists(confFile);
+            });
         if (it == _confCompatValues.end())
         {
             confFile.clear();
diff --git a/monitor/conditions.cpp b/monitor/conditions.cpp
index 35fb7a3..62e272c 100644
--- a/monitor/conditions.cpp
+++ b/monitor/conditions.cpp
@@ -23,13 +23,13 @@
 Condition propertiesMatch(std::vector<PropertyState>&& propStates)
 {
     return [pStates = std::move(propStates)](sdbusplus::bus_t& bus) {
-        return std::all_of(pStates.begin(), pStates.end(),
-                           [&bus](const auto& p) {
-            return util::SDBusPlus::getPropertyVariant<PropertyValue>(
-                       bus, std::get<propObj>(p.first),
-                       std::get<propIface>(p.first),
-                       std::get<propName>(p.first)) == p.second;
-        });
+        return std::all_of(
+            pStates.begin(), pStates.end(), [&bus](const auto& p) {
+                return util::SDBusPlus::getPropertyVariant<PropertyValue>(
+                           bus, std::get<propObj>(p.first),
+                           std::get<propIface>(p.first),
+                           std::get<propName>(p.first)) == p.second;
+            });
     };
 }
 
diff --git a/monitor/fan.cpp b/monitor/fan.cpp
index 0589593..a9ca013 100644
--- a/monitor/fan.cpp
+++ b/monitor/fan.cpp
@@ -38,8 +38,7 @@
 Fan::Fan(Mode mode, sdbusplus::bus_t& bus, const sdeventplus::Event& event,
          std::unique_ptr<trust::Manager>& trust, const FanDefinition& def,
          System& system) :
-    _bus(bus),
-    _name(def.name), _deviation(def.deviation),
+    _bus(bus), _name(def.name), _deviation(def.deviation),
     _upperDeviation(def.upperDeviation),
     _numSensorFailsForNonFunc(def.numSensorFailsForNonfunc),
     _trustManager(trust),
@@ -332,8 +331,9 @@
     uint64_t target = 0;
     // The sensor doesn't support a target,
     // so get it from another sensor.
-    auto s = std::find_if(_sensors.begin(), _sensors.end(),
-                          [](const auto& s) { return s->hasTarget(); });
+    auto s = std::find_if(_sensors.begin(), _sensors.end(), [](const auto& s) {
+        return s->hasTarget();
+    });
 
     if (s != _sensors.end())
     {
@@ -345,8 +345,9 @@
 
 size_t Fan::countNonFunctionalSensors() const
 {
-    return std::count_if(_sensors.begin(), _sensors.end(),
-                         [](const auto& s) { return !s->functional(); });
+    return std::count_if(_sensors.begin(), _sensors.end(), [](const auto& s) {
+        return !s->functional();
+    });
 }
 
 bool Fan::outOfRange(const TachSensor& sensor)
diff --git a/monitor/fan_error.cpp b/monitor/fan_error.cpp
index 396b731..6d0ef20 100644
--- a/monitor/fan_error.cpp
+++ b/monitor/fan_error.cpp
@@ -255,8 +255,8 @@
             message = getFieldValue(journal, "MESSAGE");
 
             // Build one line string containing field values
-            entries.push_back(timeStamp + " " + syslogID + "[" + pid +
-                              "]: " + message);
+            entries.push_back(
+                timeStamp + " " + syslogID + "[" + pid + "]: " + message);
 
             // Stop after number of lines was read
             if (count++ >= numLines)
diff --git a/monitor/fan_error.hpp b/monitor/fan_error.hpp
index 1f36c2f..446e513 100644
--- a/monitor/fan_error.hpp
+++ b/monitor/fan_error.hpp
@@ -97,8 +97,7 @@
              const std::string& sensor,
              sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level
                  severity) :
-        _errorName(error),
-        _fanName(fan), _sensorName(sensor),
+        _errorName(error), _fanName(fan), _sensorName(sensor),
         _severity(
             sdbusplus::xyz::openbmc_project::Logging::server::convertForMessage(
                 severity))
diff --git a/monitor/json_parser.cpp b/monitor/json_parser.cpp
index 20a3bcb..5faccb4 100644
--- a/monitor/json_parser.cpp
+++ b/monitor/json_parser.cpp
@@ -176,14 +176,15 @@
             ignoreAboveMax = sensor["ignore_above_max"].get<bool>();
         }
 
-        SensorDefinition def{.name = sensor["name"].get<std::string>(),
-                             .hasTarget = sensor["has_target"].get<bool>(),
-                             .targetInterface = targetIntf,
-                             .targetPath = targetPath,
-                             .factor = factor,
-                             .offset = offset,
-                             .threshold = threshold,
-                             .ignoreAboveMax = ignoreAboveMax};
+        SensorDefinition def{
+            .name = sensor["name"].get<std::string>(),
+            .hasTarget = sensor["has_target"].get<bool>(),
+            .targetInterface = targetIntf,
+            .targetPath = targetPath,
+            .factor = factor,
+            .offset = offset,
+            .threshold = threshold,
+            .ignoreAboveMax = ignoreAboveMax};
 
         sensorDefs.push_back(std::move(def));
     }
@@ -373,20 +374,21 @@
             setFuncOnPresent = fan["set_func_on_present"].get<bool>();
         }
 
-        FanDefinition def{.name = fan["inventory"].get<std::string>(),
-                          .method = method,
-                          .funcDelay = funcDelay,
-                          .timeout = timeout,
-                          .deviation = deviation,
-                          .upperDeviation = upperDeviation,
-                          .numSensorFailsForNonfunc = nonfuncSensorsCount,
-                          .monitorStartDelay = monitorDelay,
-                          .countInterval = countInterval,
-                          .nonfuncRotorErrDelay = nonfuncRotorErrorDelay,
-                          .fanMissingErrDelay = fanMissingErrorDelay,
-                          .sensorList = std::move(sensorDefs),
-                          .condition = cond,
-                          .funcOnPresent = setFuncOnPresent};
+        FanDefinition def{
+            .name = fan["inventory"].get<std::string>(),
+            .method = method,
+            .funcDelay = funcDelay,
+            .timeout = timeout,
+            .deviation = deviation,
+            .upperDeviation = upperDeviation,
+            .numSensorFailsForNonfunc = nonfuncSensorsCount,
+            .monitorStartDelay = monitorDelay,
+            .countInterval = countInterval,
+            .nonfuncRotorErrDelay = nonfuncRotorErrorDelay,
+            .fanMissingErrDelay = fanMissingErrorDelay,
+            .sensorList = std::move(sensorDefs),
+            .condition = cond,
+            .funcOnPresent = setFuncOnPresent};
 
         fanDefs.push_back(std::move(def));
     }
@@ -438,11 +440,11 @@
              [count]() { return std::make_unique<MissingFanFRUCause>(count); }},
             {"nonfunc_fan_rotors",
              [count]() {
-        return std::make_unique<NonfuncFanRotorCause>(count);
-    }},
+                 return std::make_unique<NonfuncFanRotorCause>(count);
+             }},
             {"fan_frus_with_nonfunc_rotors", [count]() {
-        return std::make_unique<FanFRUsWithNonfuncRotorsCause>(count);
-    }}};
+                 return std::make_unique<FanFRUsWithNonfuncRotorsCause>(count);
+             }}};
 
     auto it = causes.find(powerOffCause);
     if (it != causes.end())
@@ -512,8 +514,8 @@
     }
     else
     {
-        auto msg = std::format("Invalid 'type' entry {} in power off config",
-                               type);
+        auto msg =
+            std::format("Invalid 'type' entry {} in power off config", type);
         log<level::ERR>(msg.c_str());
         throw std::runtime_error(msg.c_str());
     }
@@ -521,10 +523,9 @@
     return action;
 }
 
-std::vector<std::unique_ptr<PowerOffRule>>
-    getPowerOffRules(const json& obj,
-                     std::shared_ptr<PowerInterfaceBase>& powerInterface,
-                     PowerOffAction::PrePowerOffFunc& func)
+std::vector<std::unique_ptr<PowerOffRule>> getPowerOffRules(
+    const json& obj, std::shared_ptr<PowerInterfaceBase>& powerInterface,
+    PowerOffAction::PrePowerOffFunc& func)
 {
     std::vector<std::unique_ptr<PowerOffRule>> rules;
 
diff --git a/monitor/json_parser.hpp b/monitor/json_parser.hpp
index 7f09fd3..30e9d02 100644
--- a/monitor/json_parser.hpp
+++ b/monitor/json_parser.hpp
@@ -92,10 +92,9 @@
  * @return std::vector<std::unique_ptr<PowerOffRule>> -
  *     The PowerOffRule objects
  */
-std::vector<std::unique_ptr<PowerOffRule>>
-    getPowerOffRules(const json& obj,
-                     std::shared_ptr<PowerInterfaceBase>& powerInterface,
-                     PowerOffAction::PrePowerOffFunc& func);
+std::vector<std::unique_ptr<PowerOffRule>> getPowerOffRules(
+    const json& obj, std::shared_ptr<PowerInterfaceBase>& powerInterface,
+    PowerOffAction::PrePowerOffFunc& func);
 
 /**
  * @brief Returns the 'num_nonfunc_rotors_before_error field
diff --git a/monitor/main.cpp b/monitor/main.cpp
index 8505c76..8c60f08 100644
--- a/monitor/main.cpp
+++ b/monitor/main.cpp
@@ -80,10 +80,10 @@
 
     // Enable SIGHUP handling to reload JSON config
     stdplus::signal::block(SIGHUP);
-    sdeventplus::source::Signal signal(event, SIGHUP,
-                                       std::bind(&System::sighupHandler,
-                                                 &system, std::placeholders::_1,
-                                                 std::placeholders::_2));
+    sdeventplus::source::Signal signal(
+        event, SIGHUP,
+        std::bind(&System::sighupHandler, &system, std::placeholders::_1,
+                  std::placeholders::_2));
 
     // Enable SIGUSR1 handling to dump debug data
     stdplus::signal::block(SIGUSR1);
diff --git a/monitor/power_off_action.hpp b/monitor/power_off_action.hpp
index 6d7580b..348173b 100644
--- a/monitor/power_off_action.hpp
+++ b/monitor/power_off_action.hpp
@@ -54,8 +54,7 @@
     PowerOffAction(const std::string& name,
                    std::shared_ptr<PowerInterfaceBase> powerInterface,
                    PrePowerOffFunc& powerOffFunc) :
-        _name(name),
-        _powerIface(std::move(powerInterface)),
+        _name(name), _powerIface(std::move(powerInterface)),
         _event(sdeventplus::Event::get_default()),
         _prePowerOffFunc(powerOffFunc)
     {}
diff --git a/monitor/power_off_cause.hpp b/monitor/power_off_cause.hpp
index bc3704f..abc2cb4 100644
--- a/monitor/power_off_cause.hpp
+++ b/monitor/power_off_cause.hpp
@@ -109,10 +109,10 @@
      */
     bool satisfied(const FanHealth& fanHealth) override
     {
-        size_t count = std::count_if(fanHealth.begin(), fanHealth.end(),
-                                     [](const auto& fan) {
-            return !std::get<presentHealthPos>(fan.second);
-        });
+        size_t count = std::count_if(
+            fanHealth.begin(), fanHealth.end(), [](const auto& fan) {
+                return !std::get<presentHealthPos>(fan.second);
+            });
 
         return count >= _count;
     }
@@ -152,13 +152,15 @@
      */
     bool satisfied(const FanHealth& fanHealth) override
     {
-        size_t count = std::accumulate(fanHealth.begin(), fanHealth.end(), 0,
-                                       [](int sum, const auto& fan) {
-            const auto& tachs = std::get<sensorFuncHealthPos>(fan.second);
-            auto nonFuncTachs = std::count_if(tachs.begin(), tachs.end(),
-                                              [](bool tach) { return !tach; });
-            return sum + nonFuncTachs;
-        });
+        size_t count = std::accumulate(
+            fanHealth.begin(), fanHealth.end(), 0,
+            [](int sum, const auto& fan) {
+                const auto& tachs = std::get<sensorFuncHealthPos>(fan.second);
+                auto nonFuncTachs =
+                    std::count_if(tachs.begin(), tachs.end(),
+                                  [](bool tach) { return !tach; });
+                return sum + nonFuncTachs;
+            });
 
         return count >= _count;
     }
@@ -201,13 +203,13 @@
      */
     bool satisfied(const FanHealth& fanHealth) override
     {
-        size_t count = std::count_if(fanHealth.begin(), fanHealth.end(),
-                                     [](const auto& fan) {
-            const auto& tachs = std::get<sensorFuncHealthPos>(fan.second);
+        size_t count = std::count_if(
+            fanHealth.begin(), fanHealth.end(), [](const auto& fan) {
+                const auto& tachs = std::get<sensorFuncHealthPos>(fan.second);
 
-            return std::any_of(tachs.begin(), tachs.end(),
-                               [](bool func) { return !func; });
-        });
+                return std::any_of(tachs.begin(), tachs.end(),
+                                   [](bool func) { return !func; });
+            });
 
         return count >= _count;
     }
diff --git a/monitor/power_off_rule.hpp b/monitor/power_off_rule.hpp
index ad17870..22e8469 100644
--- a/monitor/power_off_rule.hpp
+++ b/monitor/power_off_rule.hpp
@@ -50,8 +50,8 @@
     PowerOffRule(PowerRuleState validState,
                  std::unique_ptr<PowerOffCause> cause,
                  std::unique_ptr<PowerOffAction> action) :
-        _validState(validState),
-        _cause(std::move(cause)), _action(std::move(action))
+        _validState(validState), _cause(std::move(cause)),
+        _action(std::move(action))
     {}
 
     /**
diff --git a/monitor/system.cpp b/monitor/system.cpp
index 5c2ed4e..476a7f1 100644
--- a/monitor/system.cpp
+++ b/monitor/system.cpp
@@ -50,8 +50,7 @@
 
 System::System(Mode mode, sdbusplus::bus_t& bus,
                const sdeventplus::Event& event) :
-    _mode(mode),
-    _bus(bus), _event(event),
+    _mode(mode), _bus(bus), _event(event),
 #ifdef MONITOR_USE_HOST_STATE
     _powerState(std::make_unique<HostPowerState>(
 #else
@@ -120,8 +119,8 @@
         // off here.
         std::for_each(_powerOffRules.begin(), _powerOffRules.end(),
                       [this](auto& rule) {
-            rule->check(PowerRuleState::runtime, _fanHealth);
-        });
+                          rule->check(PowerRuleState::runtime, _fanHealth);
+                      });
     }
 
     subscribeSensorsToServices();
@@ -329,8 +328,8 @@
         sensorStatus.push_back(sensor->functional());
     }
 
-    _fanHealth[fan.getName()] = std::make_tuple(fan.present(),
-                                                std::move(sensorStatus));
+    _fanHealth[fan.getName()] =
+        std::make_tuple(fan.present(), std::move(sensorStatus));
 }
 
 void System::fanStatusChange(const Fan& fan, bool skipRulesCheck)
@@ -341,8 +340,8 @@
     {
         std::for_each(_powerOffRules.begin(), _powerOffRules.end(),
                       [this](auto& rule) {
-            rule->check(PowerRuleState::runtime, _fanHealth);
-        });
+                          rule->check(PowerRuleState::runtime, _fanHealth);
+                      });
     }
 }
 
@@ -378,18 +377,18 @@
         // If no fan has its sensors on D-Bus, then there is a problem
         // with the fan controller.  Log an error and shut down.
         if (std::all_of(_fans.begin(), _fans.end(), [](const auto& fan) {
-            return fan->numSensorsOnDBusAtPowerOn() == 0;
-        }))
+                return fan->numSensorsOnDBusAtPowerOn() == 0;
+            }))
         {
 #if DELAY_HOST_CONTROL > 0
             sleep(DELAY_HOST_CONTROL);
             std::for_each(_fans.begin(), _fans.end(),
                           [powerStateOn](auto& fan) {
-                fan->powerStateChanged(powerStateOn);
-            });
+                              fan->powerStateChanged(powerStateOn);
+                          });
             if (std::all_of(_fans.begin(), _fans.end(), [](const auto& fan) {
-                return fan->numSensorsOnDBusAtPowerOn() == 0;
-            }))
+                    return fan->numSensorsOnDBusAtPowerOn() == 0;
+                }))
             {
                 handleOfflineFanController();
                 return;
@@ -407,12 +406,12 @@
 
         std::for_each(_powerOffRules.begin(), _powerOffRules.end(),
                       [this](auto& rule) {
-            rule->check(PowerRuleState::atPgood, _fanHealth);
-        });
+                          rule->check(PowerRuleState::atPgood, _fanHealth);
+                      });
         std::for_each(_powerOffRules.begin(), _powerOffRules.end(),
                       [this](auto& rule) {
-            rule->check(PowerRuleState::runtime, _fanHealth);
-        });
+                          rule->check(PowerRuleState::runtime, _fanHealth);
+                      });
     }
     else
     {
diff --git a/monitor/tach_sensor.cpp b/monitor/tach_sensor.cpp
index 1d92231..68c58a2 100644
--- a/monitor/tach_sensor.cpp
+++ b/monitor/tach_sensor.cpp
@@ -60,8 +60,8 @@
 {
     try
     {
-        value = util::SDBusPlus::getProperty<T>(bus, path, interface,
-                                                propertyName);
+        value =
+            util::SDBusPlus::getProperty<T>(bus, path, interface, propertyName);
     }
     catch (const std::exception& e)
     {
@@ -76,8 +76,7 @@
                        size_t method, size_t threshold, bool ignoreAboveMax,
                        size_t timeout, const std::optional<size_t>& errorDelay,
                        size_t countInterval, const sdeventplus::Event& event) :
-    _bus(bus),
-    _fan(fan), _name(FAN_SENSOR_PATH + id),
+    _bus(bus), _fan(fan), _name(FAN_SENSOR_PATH + id),
     _invName(fs::path(fan.getName()) / id), _hasTarget(hasTarget),
     _funcDelay(funcDelay), _interface(interface), _path(path), _factor(factor),
     _offset(offset), _method(method), _threshold(threshold),
@@ -190,8 +189,8 @@
 {
     if (path)
     {
-        return sdbusplus::bus::match::rules::propertiesChanged(path.value(),
-                                                               interface);
+        return sdbusplus::bus::match::rules::propertiesChanged(
+            path.value(), interface);
     }
     return sdbusplus::bus::match::rules::propertiesChanged(_name, interface);
 }
@@ -205,9 +204,8 @@
     return _tachTarget;
 }
 
-std::pair<uint64_t, std::optional<uint64_t>>
-    TachSensor::getRange(const size_t lowerDeviation,
-                         const size_t upperDeviation) const
+std::pair<uint64_t, std::optional<uint64_t>> TachSensor::getRange(
+    const size_t lowerDeviation, const size_t upperDeviation) const
 {
     // Determine min/max range applying the deviation
     uint64_t min = getTarget() * (100 - lowerDeviation) / 100;
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp
index 1468ab1..74eede6 100644
--- a/monitor/tach_sensor.hpp
+++ b/monitor/tach_sensor.hpp
@@ -125,10 +125,9 @@
      * @param[out] value - the value to store the property value in
      */
     template <typename T>
-    static void readPropertyFromMessage(sdbusplus::message_t& msg,
-                                        const std::string& interface,
-                                        const std::string& propertyName,
-                                        T& value)
+    static void readPropertyFromMessage(
+        sdbusplus::message_t& msg, const std::string& interface,
+        const std::string& propertyName, T& value)
     {
         std::string sensor;
         std::map<std::string, std::variant<T>> data;
@@ -350,9 +349,8 @@
      *
      * @return pair - Min/Max(optional) range of speeds allowed
      */
-    std::pair<uint64_t, std::optional<uint64_t>>
-        getRange(const size_t lowerDeviation,
-                 const size_t upperDeviation) const;
+    std::pair<uint64_t, std::optional<uint64_t>> getRange(
+        const size_t lowerDeviation, const size_t upperDeviation) const;
 
     /**
      * @brief Processes the current state of the sensor
diff --git a/monitor/trust_group.hpp b/monitor/trust_group.hpp
index 3e73525..001076b 100644
--- a/monitor/trust_group.hpp
+++ b/monitor/trust_group.hpp
@@ -66,11 +66,11 @@
      */
     void registerSensor(std::shared_ptr<monitor::TachSensor>& sensor)
     {
-        auto found = std::find_if(_names.begin(), _names.end(),
-                                  [&sensor](const auto& name) {
-            return monitor::FAN_SENSOR_PATH + std::get<sensorName>(name) ==
-                   sensor->name();
-        });
+        auto found = std::find_if(
+            _names.begin(), _names.end(), [&sensor](const auto& name) {
+                return monitor::FAN_SENSOR_PATH + std::get<sensorName>(name) ==
+                       sensor->name();
+            });
 
         if (found != _names.end())
         {
@@ -90,8 +90,8 @@
     {
         return (std::find_if(_sensors.begin(), _sensors.end(),
                              [&sensor](const auto& s) {
-            return sensor.name() == s.sensor->name();
-        }) != _sensors.end());
+                                 return sensor.name() == s.sensor->name();
+                             }) != _sensors.end());
     }
 
     /**
diff --git a/power_state.hpp b/power_state.hpp
index c428a39..c5b0f0d 100644
--- a/power_state.hpp
+++ b/power_state.hpp
@@ -143,10 +143,11 @@
     PGoodState& operator=(PGoodState&&) = delete;
 
     PGoodState() :
-        PowerState(), _match(_bus,
-                             sdbusplus::bus::match::rules::propertiesChanged(
-                                 _pgoodPath, _pgoodInterface),
-                             [this](auto& msg) { this->pgoodChanged(msg); })
+        PowerState(),
+        _match(_bus,
+               sdbusplus::bus::match::rules::propertiesChanged(_pgoodPath,
+                                                               _pgoodInterface),
+               [this](auto& msg) { this->pgoodChanged(msg); })
     {
         readPGood();
     }
diff --git a/presence/anyof.cpp b/presence/anyof.cpp
index 6b9403a..635e6a6 100644
--- a/presence/anyof.cpp
+++ b/presence/anyof.cpp
@@ -36,8 +36,8 @@
 AnyOf::AnyOf(const Fan& fan,
              const std::vector<std::reference_wrapper<PresenceSensor>>& s,
              std::unique_ptr<EEPROMDevice> e) :
-    RedundancyPolicy(fan, std::move(e)),
-    state(), _powerState(getPowerStateObject()),
+    RedundancyPolicy(fan, std::move(e)), state(),
+    _powerState(getPowerStateObject()),
     _powerOnDelayTimer(sdeventplus::Event::get_default(),
                        std::bind(&AnyOf::delayedAfterPowerOn, this)),
     _powerOn(false)
@@ -62,10 +62,10 @@
 void AnyOf::stateChanged(bool present, PresenceSensor& sensor)
 {
     // Find the sensor that changed state.
-    auto sit = std::find_if(state.begin(), state.end(),
-                            [&sensor](const auto& s) {
-        return std::get<sensorPos>(s).get() == sensor;
-    });
+    auto sit =
+        std::find_if(state.begin(), state.end(), [&sensor](const auto& s) {
+            return std::get<sensorPos>(s).get() == sensor;
+        });
     if (sit != state.end())
     {
         auto origState =
@@ -139,9 +139,10 @@
 
     // If at least one, but not all, sensors indicate present, then
     // tell the not present ones to log a conflict if not already done.
-    if (std::any_of(
-            state.begin(), state.end(),
-            [this](const auto& s) { return std::get<presentPos>(s); }) &&
+    if (std::any_of(state.begin(), state.end(),
+                    [this](const auto& s) {
+                        return std::get<presentPos>(s);
+                    }) &&
         !std::all_of(state.begin(), state.end(),
                      [this](const auto& s) { return std::get<presentPos>(s); }))
     {
diff --git a/presence/eeprom_device.hpp b/presence/eeprom_device.hpp
index 883cc17..a193471 100644
--- a/presence/eeprom_device.hpp
+++ b/presence/eeprom_device.hpp
@@ -41,8 +41,8 @@
      */
     EEPROMDevice(const std::string& address, const std::string& driver,
                  size_t bindDelayInMS) :
-        address(address),
-        path(baseDriverPath / driver), bindDelay(bindDelayInMS),
+        address(address), path(baseDriverPath / driver),
+        bindDelay(bindDelayInMS),
         timer(SDEventPlus::getEvent(),
               std::bind(std::mem_fn(&EEPROMDevice::bindTimerExpired), this))
     {}
diff --git a/presence/error_reporter.cpp b/presence/error_reporter.cpp
index b095717..927ca2f 100644
--- a/presence/error_reporter.cpp
+++ b/presence/error_reporter.cpp
@@ -47,8 +47,7 @@
     sdbusplus::bus_t& bus,
     const std::vector<
         std::tuple<Fan, std::vector<std::unique_ptr<PresenceSensor>>>>& fans) :
-    _bus(bus),
-    _event(sdeventplus::Event::get_default()),
+    _bus(bus), _event(sdeventplus::Event::get_default()),
     _powerState(getPowerStateObject())
 {
     _powerState->addCallback("errorReporter",
@@ -212,9 +211,10 @@
         }
     }
 
-    std::for_each(
-        _fanStates.begin(), _fanStates.end(),
-        [this](const auto& fanState) { this->checkFan(fanState.first); });
+    std::for_each(_fanStates.begin(), _fanStates.end(),
+                  [this](const auto& fanState) {
+                      this->checkFan(fanState.first);
+                  });
 }
 
 } // namespace phosphor::fan::presence
diff --git a/presence/error_reporter.hpp b/presence/error_reporter.hpp
index d6bc109..ef1111b 100644
--- a/presence/error_reporter.hpp
+++ b/presence/error_reporter.hpp
@@ -43,9 +43,8 @@
      */
     ErrorReporter(
         sdbusplus::bus_t& bus,
-        const std::vector<
-            std::tuple<Fan, std::vector<std::unique_ptr<PresenceSensor>>>>&
-            fans);
+        const std::vector<std::tuple<
+            Fan, std::vector<std::unique_ptr<PresenceSensor>>>>& fans);
 
   private:
     /**
diff --git a/presence/fallback.cpp b/presence/fallback.cpp
index f301ac1..b3fc54a 100644
--- a/presence/fallback.cpp
+++ b/presence/fallback.cpp
@@ -79,8 +79,9 @@
 {
     // Find the first sensor that says the fan is present
     // and set it as the active sensor.
-    activeSensor = std::find_if(sensors.begin(), sensors.end(),
-                                [](auto& s) { return s.get().present(); });
+    activeSensor = std::find_if(sensors.begin(), sensors.end(), [](auto& s) {
+        return s.get().present();
+    });
     if (activeSensor == sensors.end())
     {
         // The first sensor is working or all sensors
diff --git a/presence/fallback.hpp b/presence/fallback.hpp
index e6a1685..b9e2cbd 100644
--- a/presence/fallback.hpp
+++ b/presence/fallback.hpp
@@ -44,8 +44,7 @@
     Fallback(const Fan& fan,
              const std::vector<std::reference_wrapper<PresenceSensor>>& s,
              std::unique_ptr<EEPROMDevice> e) :
-        RedundancyPolicy(fan, std::move(e)),
-        sensors(s)
+        RedundancyPolicy(fan, std::move(e)), sensors(s)
     {
         activeSensor = sensors.begin();
     }
diff --git a/presence/gpio.cpp b/presence/gpio.cpp
index ceba1c6..0bd5b6f 100644
--- a/presence/gpio.cpp
+++ b/presence/gpio.cpp
@@ -41,8 +41,7 @@
 
 Gpio::Gpio(const std::string& physDevice, const std::string& device,
            unsigned int physPin) :
-    currentState(false),
-    evdevfd(open(device.c_str(), O_RDONLY | O_NONBLOCK)),
+    currentState(false), evdevfd(open(device.c_str(), O_RDONLY | O_NONBLOCK)),
     evdev(evdevpp::evdev::newFromFD(evdevfd())), phys(physDevice), pin(physPin)
 {}
 
diff --git a/presence/json_parser.cpp b/presence/json_parser.cpp
index ea1d496..d5705ef 100644
--- a/presence/json_parser.cpp
+++ b/presence/json_parser.cpp
@@ -190,14 +190,14 @@
                 eeprom["bind_delay_ms"].get<size_t>());
         }
 
-        auto fan = std::make_tuple(member["name"], member["path"],
-                                   timeUntilError);
+        auto fan =
+            std::make_tuple(member["name"], member["path"], timeUntilError);
         // Create a fan object
         fans.emplace_back(std::make_tuple(fan, std::move(sensors)));
 
         // Add fan presence policy
-        auto policy = getPolicy(member["rpolicy"], fans.back(),
-                                std::move(eepromDevice));
+        auto policy =
+            getPolicy(member["rpolicy"], fans.back(), std::move(eepromDevice));
         if (policy)
         {
             policies.emplace_back(std::move(policy));
@@ -213,9 +213,9 @@
 
     // Create the error reporter class if necessary
     if (std::any_of(_fans.begin(), _fans.end(), [](const auto& fan) {
-        return std::get<std::optional<size_t>>(std::get<Fan>(fan)) !=
-               std::nullopt;
-    }))
+            return std::get<std::optional<size_t>>(std::get<Fan>(fan)) !=
+                   std::nullopt;
+        }))
     {
         _reporter = std::make_unique<ErrorReporter>(_bus, _fans);
     }
@@ -278,8 +278,8 @@
         sensors.emplace_back(sensor.get<std::string>());
     }
 
-    return std::make_unique<PolicyAccess<Tach, JsonConfig>>(fanIndex,
-                                                            std::move(sensors));
+    return std::make_unique<PolicyAccess<Tach, JsonConfig>>(
+        fanIndex, std::move(sensors));
 }
 
 // Get a constructed presence sensor for fan presence detection by gpio
@@ -363,9 +363,8 @@
 }
 
 // Get a `Fallback` redundancy policy for the fan
-std::unique_ptr<RedundancyPolicy>
-    getFallback(const fanPolicy& fan,
-                std::unique_ptr<EEPROMDevice> eepromDevice)
+std::unique_ptr<RedundancyPolicy> getFallback(
+    const fanPolicy& fan, std::unique_ptr<EEPROMDevice> eepromDevice)
 {
     std::vector<std::reference_wrapper<PresenceSensor>> pSensors;
     for (auto& fanSensor : std::get<fanPolicySensorListPos>(fan))
diff --git a/presence/json_parser.hpp b/presence/json_parser.hpp
index 9fe5645..1e23380 100644
--- a/presence/json_parser.hpp
+++ b/presence/json_parser.hpp
@@ -185,9 +185,8 @@
  *
  * @return - A `Fallback` redundancy policy
  */
-std::unique_ptr<RedundancyPolicy>
-    getFallback(const fanPolicy& fan,
-                std::unique_ptr<EEPROMDevice> eepromDevice);
+std::unique_ptr<RedundancyPolicy> getFallback(
+    const fanPolicy& fan, std::unique_ptr<EEPROMDevice> eepromDevice);
 
 } // namespace rpolicy
 
diff --git a/presence/rpolicy.hpp b/presence/rpolicy.hpp
index e190029..259a31b 100644
--- a/presence/rpolicy.hpp
+++ b/presence/rpolicy.hpp
@@ -40,8 +40,7 @@
      */
     explicit RedundancyPolicy(const Fan& f,
                               std::unique_ptr<EEPROMDevice> eeprom) :
-        fan(f),
-        eepromDevice(std::move(eeprom))
+        fan(f), eepromDevice(std::move(eeprom))
     {}
 
     /**
diff --git a/presence/tach.hpp b/presence/tach.hpp
index db8efa2..d45d595 100644
--- a/presence/tach.hpp
+++ b/presence/tach.hpp
@@ -90,9 +90,8 @@
      * @param[in] sensor - The sensor that changed.
      * @param[in] props - The properties that changed.
      */
-    void
-        propertiesChanged(size_t sensor,
-                          const phosphor::fan::util::Properties<double>& props);
+    void propertiesChanged(
+        size_t sensor, const phosphor::fan::util::Properties<double>& props);
 
     /**
      * @brief Properties changed handler for tach sensor updates.
diff --git a/sdbusplus.hpp b/sdbusplus.hpp
index 9627e40..4068923 100644
--- a/sdbusplus.hpp
+++ b/sdbusplus.hpp
@@ -167,10 +167,9 @@
 
     /** @brief Invoke a method and read the response. */
     template <typename Ret, typename... Args>
-    static auto callMethodAndRead(const std::string& busName,
-                                  const std::string& path,
-                                  const std::string& interface,
-                                  const std::string& method, Args&&... args)
+    static auto callMethodAndRead(
+        const std::string& busName, const std::string& path,
+        const std::string& interface, const std::string& method, Args&&... args)
     {
         return callMethodAndRead<Ret>(getBus(), busName, path, interface,
                                       method, std::forward<Args>(args)...);
@@ -189,11 +188,11 @@
         using Objects = std::map<Path, std::map<Serv, Intfs>>;
         Intfs intfs = {interface};
 
-        return callMethodAndRead<Objects>(bus,
-                                          "xyz.openbmc_project.ObjectMapper"s,
-                                          "/xyz/openbmc_project/object_mapper"s,
-                                          "xyz.openbmc_project.ObjectMapper"s,
-                                          "GetSubTree"s, path, depth, intfs);
+        return callMethodAndRead<Objects>(
+            bus, "xyz.openbmc_project.ObjectMapper"s,
+            "/xyz/openbmc_project/object_mapper"s,
+            "xyz.openbmc_project.ObjectMapper"s, "GetSubTree"s, path, depth,
+            intfs);
     }
 
     /** @brief Get subtree from the mapper without checking response,
@@ -210,11 +209,11 @@
         using Intfs = std::vector<Intf>;
         using Objects = std::map<Path, std::map<Serv, Intfs>>;
 
-        return callMethodAndRead<Objects>(bus,
-                                          "xyz.openbmc_project.ObjectMapper"s,
-                                          "/xyz/openbmc_project/object_mapper"s,
-                                          "xyz.openbmc_project.ObjectMapper"s,
-                                          "GetSubTree"s, path, depth, intfs);
+        return callMethodAndRead<Objects>(
+            bus, "xyz.openbmc_project.ObjectMapper"s,
+            "/xyz/openbmc_project/object_mapper"s,
+            "xyz.openbmc_project.ObjectMapper"s, "GetSubTree"s, path, depth,
+            intfs);
     }
 
     /** @brief Get subtree from the mapper. */
@@ -344,9 +343,9 @@
         using namespace std::literals::string_literals;
 
         auto service = getService(bus, path, interface);
-        auto msg = callMethod(bus, service, path,
-                              "org.freedesktop.DBus.Properties"s, "Get"s,
-                              interface, property);
+        auto msg =
+            callMethod(bus, service, path, "org.freedesktop.DBus.Properties"s,
+                       "Get"s, interface, property);
         if (msg.is_method_error())
         {
             throw DBusPropertyError{"DBus get property failed", service, path,
@@ -368,17 +367,16 @@
 
     /** @brief Get a property variant with mapper lookup. */
     template <typename Variant>
-    static auto getPropertyVariant(sdbusplus::bus_t& bus,
-                                   const std::string& path,
-                                   const std::string& interface,
-                                   const std::string& property)
+    static auto getPropertyVariant(
+        sdbusplus::bus_t& bus, const std::string& path,
+        const std::string& interface, const std::string& property)
     {
         using namespace std::literals::string_literals;
 
         auto service = getService(bus, path, interface);
-        auto msg = callMethod(bus, service, path,
-                              "org.freedesktop.DBus.Properties"s, "Get"s,
-                              interface, property);
+        auto msg =
+            callMethod(bus, service, path, "org.freedesktop.DBus.Properties"s,
+                       "Get"s, interface, property);
         if (msg.is_method_error())
         {
             throw DBusPropertyError{"DBus get property variant failed", service,
@@ -400,11 +398,10 @@
 
     /** @brief Invoke a method and return without checking for error. */
     template <typename... Args>
-    static auto callMethodAndReturn(sdbusplus::bus_t& bus,
-                                    const std::string& busName,
-                                    const std::string& path,
-                                    const std::string& interface,
-                                    const std::string& method, Args&&... args)
+    static auto callMethodAndReturn(
+        sdbusplus::bus_t& bus, const std::string& busName,
+        const std::string& path, const std::string& interface,
+        const std::string& method, Args&&... args)
     {
         auto reqMsg = bus.new_method_call(busName.c_str(), path.c_str(),
                                           interface.c_str(), method.c_str());
@@ -448,11 +445,10 @@
 
     /** @brief Get a property variant without mapper lookup. */
     template <typename Variant>
-    static auto getPropertyVariant(sdbusplus::bus_t& bus,
-                                   const std::string& service,
-                                   const std::string& path,
-                                   const std::string& interface,
-                                   const std::string& property)
+    static auto getPropertyVariant(
+        sdbusplus::bus_t& bus, const std::string& service,
+        const std::string& path, const std::string& interface,
+        const std::string& property)
     {
         using namespace std::literals::string_literals;
 
@@ -471,10 +467,9 @@
 
     /** @brief Get a property variant without mapper lookup. */
     template <typename Variant>
-    static auto getPropertyVariant(const std::string& service,
-                                   const std::string& path,
-                                   const std::string& interface,
-                                   const std::string& property)
+    static auto getPropertyVariant(
+        const std::string& service, const std::string& path,
+        const std::string& interface, const std::string& property)
     {
         return getPropertyVariant<Variant>(getBus(), service, path, interface,
                                            property);
@@ -544,10 +539,9 @@
 
     /** @brief Invoke method with mapper lookup. */
     template <typename... Args>
-    static auto lookupAndCallMethod(sdbusplus::bus_t& bus,
-                                    const std::string& path,
-                                    const std::string& interface,
-                                    const std::string& method, Args&&... args)
+    static auto lookupAndCallMethod(
+        sdbusplus::bus_t& bus, const std::string& path,
+        const std::string& interface, const std::string& method, Args&&... args)
     {
         return callMethod(bus, getService(bus, path, interface), path,
                           interface, method, std::forward<Args>(args)...);
@@ -565,10 +559,9 @@
 
     /** @brief Invoke method and read with mapper lookup. */
     template <typename Ret, typename... Args>
-    static auto
-        lookupCallMethodAndRead(sdbusplus::bus_t& bus, const std::string& path,
-                                const std::string& interface,
-                                const std::string& method, Args&&... args)
+    static auto lookupCallMethodAndRead(
+        sdbusplus::bus_t& bus, const std::string& path,
+        const std::string& interface, const std::string& method, Args&&... args)
     {
         return callMethodAndRead(bus, getService(bus, path, interface), path,
                                  interface, method,
@@ -577,10 +570,9 @@
 
     /** @brief Invoke method and read with mapper lookup. */
     template <typename Ret, typename... Args>
-    static auto lookupCallMethodAndRead(const std::string& path,
-                                        const std::string& interface,
-                                        const std::string& method,
-                                        Args&&... args)
+    static auto lookupCallMethodAndRead(
+        const std::string& path, const std::string& interface,
+        const std::string& method, Args&&... args)
     {
         return lookupCallMethodAndRead<Ret>(getBus(), path, interface, method,
                                             std::forward<Args>(args)...);
diff --git a/sensor-monitor/shutdown_alarm_monitor.cpp b/sensor-monitor/shutdown_alarm_monitor.cpp
index 214e3a3..9b51a8b 100644
--- a/sensor-monitor/shutdown_alarm_monitor.cpp
+++ b/sensor-monitor/shutdown_alarm_monitor.cpp
@@ -88,8 +88,7 @@
 ShutdownAlarmMonitor::ShutdownAlarmMonitor(
     sdbusplus::bus_t& bus, sdeventplus::Event& event,
     std::shared_ptr<PowerState> powerState) :
-    bus(bus),
-    event(event), _powerState(std::move(powerState)),
+    bus(bus), event(event), _powerState(std::move(powerState)),
     hardShutdownMatch(bus,
                       "type='signal',member='PropertiesChanged',"
                       "path_namespace='/xyz/openbmc_project/sensors',"
@@ -133,13 +132,14 @@
 
         auto shutdownType2 = shutdownType;
 
-        std::for_each(paths.begin(), paths.end(),
-                      [this, shutdownType2](const auto& path) {
-            alarms.emplace(AlarmKey{path, shutdownType2, AlarmType::high},
-                           nullptr);
-            alarms.emplace(AlarmKey{path, shutdownType2, AlarmType::low},
-                           nullptr);
-        });
+        std::for_each(
+            paths.begin(), paths.end(),
+            [this, shutdownType2](const auto& path) {
+                alarms.emplace(AlarmKey{path, shutdownType2, AlarmType::high},
+                               nullptr);
+                alarms.emplace(AlarmKey{path, shutdownType2, AlarmType::low},
+                               nullptr);
+            });
     }
 }
 
diff --git a/sensor-monitor/threshold_alarm_logger.cpp b/sensor-monitor/threshold_alarm_logger.cpp
index 29cd229..6d78c0a 100644
--- a/sensor-monitor/threshold_alarm_logger.cpp
+++ b/sensor-monitor/threshold_alarm_logger.cpp
@@ -89,8 +89,7 @@
 ThresholdAlarmLogger::ThresholdAlarmLogger(
     sdbusplus::bus_t& bus, sdeventplus::Event& event,
     std::shared_ptr<PowerState> powerState) :
-    bus(bus),
-    event(event), _powerState(std::move(powerState)),
+    bus(bus), event(event), _powerState(std::move(powerState)),
     warningMatch(bus,
                  "type='signal',member='PropertiesChanged',"
                  "path_namespace='/xyz/openbmc_project/sensors',"
@@ -128,17 +127,20 @@
                                        this, std::placeholders::_1));
 
     // check for any currently asserted threshold alarms
-    std::for_each(thresholdData.begin(), thresholdData.end(),
-                  [this](const auto& thresholdInterface) {
-        const auto& interface = thresholdInterface.first;
-        auto objects = SDBusPlus::getSubTreeRaw(this->bus, "/", interface, 0);
-        std::for_each(objects.begin(), objects.end(),
-                      [interface, this](const auto& object) {
-            const auto& path = object.first;
-            const auto& service = object.second.begin()->first;
-            checkThresholds(interface, path, service);
+    std::for_each(
+        thresholdData.begin(), thresholdData.end(),
+        [this](const auto& thresholdInterface) {
+            const auto& interface = thresholdInterface.first;
+            auto objects =
+                SDBusPlus::getSubTreeRaw(this->bus, "/", interface, 0);
+            std::for_each(objects.begin(), objects.end(),
+                          [interface, this](const auto& object) {
+                              const auto& path = object.first;
+                              const auto& service =
+                                  object.second.begin()->first;
+                              checkThresholds(interface, path, service);
+                          });
         });
-    });
 }
 
 void ThresholdAlarmLogger::propertiesChanged(sdbusplus::message_t& msg)
@@ -262,10 +264,9 @@
     }
 }
 
-void ThresholdAlarmLogger::createEventLog(const std::string& sensorPath,
-                                          const std::string& interface,
-                                          const std::string& alarmProperty,
-                                          bool alarmValue)
+void ThresholdAlarmLogger::createEventLog(
+    const std::string& sensorPath, const std::string& interface,
+    const std::string& alarmProperty, bool alarmValue)
 {
     std::map<std::string, std::string> ad;
 
@@ -332,8 +333,8 @@
 
     try
     {
-        auto thresholdValue = SDBusPlus::getProperty<double>(bus, sensorPath,
-                                                             interface, name);
+        auto thresholdValue =
+            SDBusPlus::getProperty<double>(bus, sensorPath, interface, name);
 
         ad.emplace("THRESHOLD_VALUE", std::to_string(thresholdValue));
 
