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/src/config_parser.cpp b/src/config_parser.cpp
index e73c889..e4886ec 100644
--- a/src/config_parser.cpp
+++ b/src/config_parser.cpp
@@ -54,9 +54,8 @@
     return dir / stdplus::strCat(intf, ".netdev"sv);
 }
 
-const std::string*
-    SectionMap::getLastValueString(std::string_view section,
-                                   std::string_view key) const noexcept
+const std::string* SectionMap::getLastValueString(
+    std::string_view section, std::string_view key) const noexcept
 {
     auto sit = find(section);
     if (sit == end())
diff --git a/src/dhcp_configuration.cpp b/src/dhcp_configuration.cpp
index b818a59..da785cc 100644
--- a/src/dhcp_configuration.cpp
+++ b/src/dhcp_configuration.cpp
@@ -17,12 +17,10 @@
 using namespace phosphor::network;
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
 
-Configuration::Configuration(sdbusplus::bus_t& bus,
-                             stdplus::const_zstring objPath,
-                             stdplus::PinnedRef<EthernetInterface> parent,
-                             DHCPType type) :
-    Iface(bus, objPath.c_str(), Iface::action::defer_emit),
-    parent(parent)
+Configuration::Configuration(
+    sdbusplus::bus_t& bus, stdplus::const_zstring objPath,
+    stdplus::PinnedRef<EthernetInterface> parent, DHCPType type) :
+    Iface(bus, objPath.c_str(), Iface::action::defer_emit), parent(parent)
 {
     config::Parser conf(config::pathForIntfConf(
         parent.get().manager.get().getConfDir(), parent.get().interfaceName()));
diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
index cd06003..6a34492 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
@@ -79,24 +79,20 @@
     return a.isUnicast() && !a.isLoopback();
 }
 
-EthernetInterface::EthernetInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
-                                     stdplus::PinnedRef<Manager> manager,
-                                     const AllIntfInfo& info,
-                                     std::string_view objRoot,
-                                     const config::Parser& config,
-                                     bool enabled) :
+EthernetInterface::EthernetInterface(
+    stdplus::PinnedRef<sdbusplus::bus_t> bus,
+    stdplus::PinnedRef<Manager> manager, const AllIntfInfo& info,
+    std::string_view objRoot, const config::Parser& config, bool enabled) :
     EthernetInterface(bus, manager, info, makeObjPath(objRoot, *info.intf.name),
                       config, enabled)
 {}
 
-EthernetInterface::EthernetInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
-                                     stdplus::PinnedRef<Manager> manager,
-                                     const AllIntfInfo& info,
-                                     std::string&& objPath,
-                                     const config::Parser& config,
-                                     bool enabled) :
-    Ifaces(bus, objPath.c_str(), Ifaces::action::defer_emit),
-    manager(manager), bus(bus), objPath(std::move(objPath))
+EthernetInterface::EthernetInterface(
+    stdplus::PinnedRef<sdbusplus::bus_t> bus,
+    stdplus::PinnedRef<Manager> manager, const AllIntfInfo& info,
+    std::string&& objPath, const config::Parser& config, bool enabled) :
+    Ifaces(bus, objPath.c_str(), Ifaces::action::defer_emit), manager(manager),
+    bus(bus), objPath(std::move(objPath))
 {
     interfaceName(*info.intf.name, true);
     auto dhcpVal = getDHCPValue(config);
@@ -234,10 +230,10 @@
     }
     else
     {
-        staticNeighbors.emplace(*info.addr, std::make_unique<Neighbor>(
-                                                bus, std::string_view(objPath),
-                                                *this, *info.addr, *info.mac,
-                                                Neighbor::State::Permanent));
+        staticNeighbors.emplace(
+            *info.addr, std::make_unique<Neighbor>(
+                            bus, std::string_view(objPath), *this, *info.addr,
+                            *info.mac, Neighbor::State::Permanent));
     }
 }
 
@@ -397,12 +393,12 @@
 EthernetInterface::DHCPConf EthernetInterface::dhcpEnabled(DHCPConf value)
 {
     auto old4 = EthernetInterfaceIntf::dhcp4();
-    auto new4 = EthernetInterfaceIntf::dhcp4(value == DHCPConf::v4 ||
-                                             value == DHCPConf::v4v6stateless ||
-                                             value == DHCPConf::both);
+    auto new4 = EthernetInterfaceIntf::dhcp4(
+        value == DHCPConf::v4 || value == DHCPConf::v4v6stateless ||
+        value == DHCPConf::both);
     auto old6 = EthernetInterfaceIntf::dhcp6();
-    auto new6 = EthernetInterfaceIntf::dhcp6(value == DHCPConf::v6 ||
-                                             value == DHCPConf::both);
+    auto new6 = EthernetInterfaceIntf::dhcp6(
+        value == DHCPConf::v6 || value == DHCPConf::both);
     auto oldra = EthernetInterfaceIntf::ipv6AcceptRA();
     auto newra = EthernetInterfaceIntf::ipv6AcceptRA(
         value == DHCPConf::v6stateless || value == DHCPConf::v4v6stateless ||
@@ -456,8 +452,9 @@
     {
         // We only need to bring down the interface, networkd will always bring
         // up managed interfaces
-        manager.get().addReloadPreHook(
-            [ifname = interfaceName()]() { system::setNICUp(ifname, false); });
+        manager.get().addReloadPreHook([ifname = interfaceName()]() {
+            system::setNICUp(ifname, false);
+        });
     }
     manager.get().reloadConfigs();
 
@@ -513,9 +510,9 @@
 ServerList EthernetInterface::getNTPServerFromTimeSyncd()
 {
     ServerList servers; // Variable to capture the NTP Server IPs
-    auto method = bus.get().new_method_call(TIMESYNCD_SERVICE,
-                                            TIMESYNCD_SERVICE_PATH,
-                                            PROPERTY_INTERFACE, METHOD_GET);
+    auto method =
+        bus.get().new_method_call(TIMESYNCD_SERVICE, TIMESYNCD_SERVICE_PATH,
+                                  PROPERTY_INTERFACE, METHOD_GET);
 
     method.append(TIMESYNCD_INTERFACE, "LinkNTPServers");
 
@@ -812,8 +809,8 @@
         dhcp6["SendHostname"].emplace_back(
             tfStr(dhcp6Conf->sendHostNameEnabled()));
     }
-    auto path = config::pathForIntfConf(manager.get().getConfDir(),
-                                        interfaceName());
+    auto path =
+        config::pathForIntfConf(manager.get().getConfDir(), interfaceName());
     config.writeFile(path);
     lg2::info("Wrote networkd file: {CFG_FILE}", "CFG_FILE", path);
     writeUpdatedTime(manager, path);
@@ -995,8 +992,9 @@
     if (eth.get().ifIdx > 0)
     {
         // We need to forcibly delete the interface as systemd does not
-        eth.get().manager.get().addReloadPostHook(
-            [idx = eth.get().ifIdx]() { system::deleteIntf(idx); });
+        eth.get().manager.get().addReloadPostHook([idx = eth.get().ifIdx]() {
+            system::deleteIntf(idx);
+        });
 
         // Ignore the interface so the reload doesn't re-query it
         eth.get().manager.get().ignoredIntf.emplace(eth.get().ifIdx);
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.cpp b/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.cpp
index 8f5aac9..195b2c0 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.cpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.cpp
@@ -59,12 +59,12 @@
 HypEthInterface::DHCPConf HypEthInterface::dhcpEnabled(DHCPConf value)
 {
     auto old4 = HypEthernetIntf::dhcp4();
-    auto new4 = HypEthernetIntf::dhcp4(value == DHCPConf::v4 ||
-                                       value == DHCPConf::v4v6stateless ||
-                                       value == DHCPConf::both);
+    auto new4 = HypEthernetIntf::dhcp4(
+        value == DHCPConf::v4 || value == DHCPConf::v4v6stateless ||
+        value == DHCPConf::both);
     auto old6 = HypEthernetIntf::dhcp6();
-    auto new6 = HypEthernetIntf::dhcp6(value == DHCPConf::v6 ||
-                                       value == DHCPConf::both);
+    auto new6 = HypEthernetIntf::dhcp6(
+        value == DHCPConf::v6 || value == DHCPConf::both);
     auto oldra = HypEthernetIntf::ipv6AcceptRA();
     auto newra = HypEthernetIntf::ipv6AcceptRA(
         value == DHCPConf::v6stateless || value == DHCPConf::v4v6stateless ||
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.hpp b/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.hpp
index b2f4856..5fce963 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.hpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.hpp
@@ -53,8 +53,8 @@
      */
     HypEthInterface(sdbusplus::bus_t& bus, const char* path,
                     std::string_view intfName, HypNetworkMgr& parent) :
-        CreateIface(bus, path, CreateIface::action::defer_emit),
-        bus(bus), objectPath(path), manager(parent)
+        CreateIface(bus, path, CreateIface::action::defer_emit), bus(bus),
+        objectPath(path), manager(parent)
     {
         HypEthernetIntf::interfaceName(intfName.data(), true);
         emit_object_added();
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.cpp b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.cpp
index 16d3d29..2539b6b 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.cpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.cpp
@@ -104,8 +104,8 @@
         interfaces.emplace_back(biosMgrIntf);
         auto depth = 0;
 
-        auto mapperCall = bus.new_method_call(mapperBus, mapperObj, mapperIntf,
-                                              "GetSubTree");
+        auto mapperCall =
+            bus.new_method_call(mapperBus, mapperObj, mapperIntf, "GetSubTree");
 
         mapperCall.append(biosMgrObj, depth, interfaces);
 
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
index 6501e86..f01a4b9 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
@@ -68,7 +68,7 @@
      *  @param[in] path - Path to attach at.
      */
     HypNetworkMgr(sdbusplus::bus_t& bus, const char* path) :
-        bus(bus), objectPath(path){};
+        bus(bus), objectPath(path) {};
 
     /** @brief Get the BaseBiosTable attributes
      *
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_sys_config.hpp b/src/ibm/hypervisor-network-mgr-src/hyp_sys_config.hpp
index 464ed64..5a6fd39 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_sys_config.hpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_sys_config.hpp
@@ -41,8 +41,8 @@
      */
     HypSysConfig(sdbusplus::bus_t& bus, const std::string& objPath,
                  HypNetworkMgr& parent) :
-        Iface(bus, objPath.c_str(), Iface::action::defer_emit),
-        bus(bus), manager(parent){};
+        Iface(bus, objPath.c_str(), Iface::action::defer_emit), bus(bus),
+        manager(parent) {};
 
     /** @brief set the hostname of the system.
      *  @param[in] name - host name of the system.
diff --git a/src/inventory_mac.cpp b/src/inventory_mac.cpp
index 8e0f3cb..b5fd5f7 100644
--- a/src/inventory_mac.cpp
+++ b/src/inventory_mac.cpp
@@ -86,8 +86,8 @@
 
     auto depth = 0;
 
-    auto mapperCall = bus.new_method_call(mapperBus, mapperObj, mapperIntf,
-                                          "GetSubTree");
+    auto mapperCall =
+        bus.new_method_call(mapperBus, mapperObj, mapperIntf, "GetSubTree");
 
     mapperCall.append(invRoot, depth, interfaces);
 
@@ -177,8 +177,8 @@
             for (const auto& keys : configJson.items())
             {
                 if (!(std::find(first_boot_status.begin(),
-                                first_boot_status.end(),
-                                keys.key()) != first_boot_status.end()))
+                                first_boot_status.end(), keys.key()) !=
+                      first_boot_status.end()))
                 {
                     lg2::info("Interface {NET_INTF} MAC is NOT set from VPD",
                               "NET_INTF", keys.key());
diff --git a/src/ncsi_util.cpp b/src/ncsi_util.cpp
index 826d7de..839c80d 100644
--- a/src/ncsi_util.cpp
+++ b/src/ncsi_util.cpp
@@ -69,8 +69,7 @@
     Command(
         int ncsiCmd, int operation = DEFAULT_VALUE,
         std::span<const unsigned char> p = std::span<const unsigned char>()) :
-        ncsi_cmd(ncsiCmd),
-        operation(operation), payload(p)
+        ncsi_cmd(ncsiCmd), operation(operation), payload(p)
     {}
 
     int ncsi_cmd;
@@ -257,8 +256,8 @@
     }
 
     auto data_len = nla_len(tb[NCSI_ATTR_DATA]) - sizeof(NCSIPacketHeader);
-    unsigned char* data = (unsigned char*)nla_data(tb[NCSI_ATTR_DATA]) +
-                          sizeof(NCSIPacketHeader);
+    unsigned char* data =
+        (unsigned char*)nla_data(tb[NCSI_ATTR_DATA]) + sizeof(NCSIPacketHeader);
 
     // Dump the response to stdout. Enhancement: option to save response data
     auto str = toHexStr(std::span<const unsigned char>(data, data_len));
@@ -347,8 +346,8 @@
 
     if (cmd.operation != DEFAULT_VALUE)
     {
-        std::vector<unsigned char> pl(sizeof(NCSIPacketHeader) +
-                                      cmd.payload.size());
+        std::vector<unsigned char> pl(
+            sizeof(NCSIPacketHeader) + cmd.payload.size());
         NCSIPacketHeader* hdr = (NCSIPacketHeader*)pl.data();
 
         std::copy(cmd.payload.begin(), cmd.payload.end(),
diff --git a/src/network_manager.cpp b/src/network_manager.cpp
index 089e0e7..c412923 100644
--- a/src/network_manager.cpp
+++ b/src/network_manager.cpp
@@ -48,32 +48,33 @@
     systemdNetworkdEnabledMatch(
         bus, enabledMatch,
         [man = stdplus::PinnedRef(*this)](sdbusplus::message_t& m) {
-    std::string intf;
-    std::unordered_map<std::string, std::variant<std::string>> values;
-    try
-    {
-        m.read(intf, values);
-        auto it = values.find("AdministrativeState");
-        if (it == values.end())
-        {
-            return;
-        }
-        const std::string_view obj = m.get_path();
-        auto sep = obj.rfind('/');
-        if (sep == obj.npos || sep + 3 > obj.size())
-        {
-            throw std::invalid_argument("Invalid obj path");
-        }
-        auto ifidx = stdplus::StrToInt<10, uint16_t>{}(obj.substr(sep + 3));
-        const auto& state = std::get<std::string>(it->second);
-        man.get().handleAdminState(state, ifidx);
-    }
-    catch (const std::exception& e)
-    {
-        lg2::error("AdministrativeState match parsing failed: {ERROR}", "ERROR",
-                   e);
-    }
-})
+            std::string intf;
+            std::unordered_map<std::string, std::variant<std::string>> values;
+            try
+            {
+                m.read(intf, values);
+                auto it = values.find("AdministrativeState");
+                if (it == values.end())
+                {
+                    return;
+                }
+                const std::string_view obj = m.get_path();
+                auto sep = obj.rfind('/');
+                if (sep == obj.npos || sep + 3 > obj.size())
+                {
+                    throw std::invalid_argument("Invalid obj path");
+                }
+                auto ifidx =
+                    stdplus::StrToInt<10, uint16_t>{}(obj.substr(sep + 3));
+                const auto& state = std::get<std::string>(it->second);
+                man.get().handleAdminState(state, ifidx);
+            }
+            catch (const std::exception& e)
+            {
+                lg2::error("AdministrativeState match parsing failed: {ERROR}",
+                           "ERROR", e);
+            }
+        })
 {
     reload.get().setCallback([self = stdplus::PinnedRef(*this)]() {
         for (auto& hook : self.get().reloadPreHooks)
@@ -139,8 +140,8 @@
     {
         unsigned ifidx = std::get<0>(link);
         stdplus::ToStrHandle<stdplus::IntToStr<10, unsigned>> tsh;
-        auto obj = stdplus::strCat("/org/freedesktop/network1/link/_3"sv,
-                                   tsh(ifidx));
+        auto obj =
+            stdplus::strCat("/org/freedesktop/network1/link/_3"sv, tsh(ifidx));
         auto req =
             bus.get().new_method_call("org.freedesktop.network1", obj.c_str(),
                                       "org.freedesktop.DBus.Properties", "Get");
@@ -362,34 +363,36 @@
     {
         std::visit(
             [&](auto addr) {
-            if constexpr (std::is_same_v<stdplus::In4Addr, decltype(addr)>)
-            {
-                it->second.defgw4.emplace(addr);
-            }
-            else
-            {
-                static_assert(std::is_same_v<stdplus::In6Addr, decltype(addr)>);
-                it->second.defgw6.emplace(addr);
-            }
-        },
-            addr);
-        if (auto it = interfacesByIdx.find(ifidx); it != interfacesByIdx.end())
-        {
-            std::visit(
-                [&](auto addr) {
                 if constexpr (std::is_same_v<stdplus::In4Addr, decltype(addr)>)
                 {
-                    it->second->EthernetInterfaceIntf::defaultGateway(
-                        stdplus::toStr(addr));
+                    it->second.defgw4.emplace(addr);
                 }
                 else
                 {
                     static_assert(
                         std::is_same_v<stdplus::In6Addr, decltype(addr)>);
-                    it->second->EthernetInterfaceIntf::defaultGateway6(
-                        stdplus::toStr(addr));
+                    it->second.defgw6.emplace(addr);
                 }
             },
+            addr);
+        if (auto it = interfacesByIdx.find(ifidx); it != interfacesByIdx.end())
+        {
+            std::visit(
+                [&](auto addr) {
+                    if constexpr (std::is_same_v<stdplus::In4Addr,
+                                                 decltype(addr)>)
+                    {
+                        it->second->EthernetInterfaceIntf::defaultGateway(
+                            stdplus::toStr(addr));
+                    }
+                    else
+                    {
+                        static_assert(
+                            std::is_same_v<stdplus::In6Addr, decltype(addr)>);
+                        it->second->EthernetInterfaceIntf::defaultGateway6(
+                            stdplus::toStr(addr));
+                    }
+                },
                 addr);
         }
     }
@@ -405,46 +408,52 @@
     {
         std::visit(
             [&](auto addr) {
-            if constexpr (std::is_same_v<stdplus::In4Addr, decltype(addr)>)
-            {
-                if (it->second.defgw4 == addr)
-                {
-                    it->second.defgw4.reset();
-                }
-            }
-            else
-            {
-                static_assert(std::is_same_v<stdplus::In6Addr, decltype(addr)>);
-                if (it->second.defgw6 == addr)
-                {
-                    it->second.defgw6.reset();
-                }
-            }
-        },
-            addr);
-        if (auto it = interfacesByIdx.find(ifidx); it != interfacesByIdx.end())
-        {
-            std::visit(
-                [&](auto addr) {
                 if constexpr (std::is_same_v<stdplus::In4Addr, decltype(addr)>)
                 {
-                    stdplus::ToStrHandle<stdplus::ToStr<stdplus::In4Addr>> tsh;
-                    if (it->second->defaultGateway() == tsh(addr))
+                    if (it->second.defgw4 == addr)
                     {
-                        it->second->EthernetInterfaceIntf::defaultGateway("");
+                        it->second.defgw4.reset();
                     }
                 }
                 else
                 {
                     static_assert(
                         std::is_same_v<stdplus::In6Addr, decltype(addr)>);
-                    stdplus::ToStrHandle<stdplus::ToStr<stdplus::In6Addr>> tsh;
-                    if (it->second->defaultGateway6() == tsh(addr))
+                    if (it->second.defgw6 == addr)
                     {
-                        it->second->EthernetInterfaceIntf::defaultGateway6("");
+                        it->second.defgw6.reset();
                     }
                 }
             },
+            addr);
+        if (auto it = interfacesByIdx.find(ifidx); it != interfacesByIdx.end())
+        {
+            std::visit(
+                [&](auto addr) {
+                    if constexpr (std::is_same_v<stdplus::In4Addr,
+                                                 decltype(addr)>)
+                    {
+                        stdplus::ToStrHandle<stdplus::ToStr<stdplus::In4Addr>>
+                            tsh;
+                        if (it->second->defaultGateway() == tsh(addr))
+                        {
+                            it->second->EthernetInterfaceIntf::defaultGateway(
+                                "");
+                        }
+                    }
+                    else
+                    {
+                        static_assert(
+                            std::is_same_v<stdplus::In6Addr, decltype(addr)>);
+                        stdplus::ToStrHandle<stdplus::ToStr<stdplus::In6Addr>>
+                            tsh;
+                        if (it->second->defaultGateway6() == tsh(addr))
+                        {
+                            it->second->EthernetInterfaceIntf::defaultGateway6(
+                                "");
+                        }
+                    }
+                },
                 addr);
         }
     }
diff --git a/src/rtnetlink_server.cpp b/src/rtnetlink_server.cpp
index 1e3ac71..4a211d5 100644
--- a/src/rtnetlink_server.cpp
+++ b/src/rtnetlink_server.cpp
@@ -123,8 +123,8 @@
 Server::Server(sdeventplus::Event& event, Manager& manager) :
     sock(makeSock()),
     io(event, sock.get(), EPOLLIN | EPOLLET, [&](auto&&... args) {
-    return eventHandler(manager, std::forward<decltype(args)>(args)...);
-})
+        return eventHandler(manager, std::forward<decltype(args)>(args)...);
+    })
 {
     auto cb = [&](const nlmsghdr& hdr, std::string_view data) {
         handler(manager, hdr, data);
diff --git a/src/system_configuration.cpp b/src/system_configuration.cpp
index b008dba..ee6cdb7 100644
--- a/src/system_configuration.cpp
+++ b/src/system_configuration.cpp
@@ -26,34 +26,35 @@
 
 SystemConfiguration::SystemConfiguration(
     stdplus::PinnedRef<sdbusplus::bus_t> bus, stdplus::const_zstring objPath) :
-    Iface(bus, objPath.c_str(), Iface::action::defer_emit),
-    bus(bus), hostnamePropMatch(
-                  bus, propMatch,
-                  [sc = stdplus::PinnedRef(*this)](sdbusplus::message_t& m) {
-    std::string intf;
-    std::unordered_map<std::string, std::variant<std::string>> values;
-    try
-    {
-        m.read(intf, values);
-        auto it = values.find("Hostname");
-        if (it == values.end())
-        {
-            return;
-        }
-        sc.get().Iface::hostName(std::get<std::string>(it->second));
-    }
-    catch (const std::exception& e)
-    {
-        lg2::error("Hostname match parsing failed: {ERROR}", "ERROR", e);
-    }
-})
+    Iface(bus, objPath.c_str(), Iface::action::defer_emit), bus(bus),
+    hostnamePropMatch(
+        bus, propMatch,
+        [sc = stdplus::PinnedRef(*this)](sdbusplus::message_t& m) {
+            std::string intf;
+            std::unordered_map<std::string, std::variant<std::string>> values;
+            try
+            {
+                m.read(intf, values);
+                auto it = values.find("Hostname");
+                if (it == values.end())
+                {
+                    return;
+                }
+                sc.get().Iface::hostName(std::get<std::string>(it->second));
+            }
+            catch (const std::exception& e)
+            {
+                lg2::error("Hostname match parsing failed: {ERROR}", "ERROR",
+                           e);
+            }
+        })
 {
     try
     {
         std::variant<std::string> name;
-        auto req = bus.get().new_method_call(HOSTNAMED_SVC, HOSTNAMED_OBJ,
-                                             "org.freedesktop.DBus.Properties",
-                                             "Get");
+        auto req =
+            bus.get().new_method_call(HOSTNAMED_SVC, HOSTNAMED_OBJ,
+                                      "org.freedesktop.DBus.Properties", "Get");
 
         req.append(HOSTNAMED_INTF, "Hostname");
         auto reply = req.call();
diff --git a/src/system_queries.cpp b/src/system_queries.cpp
index 87ba4aa..712fc08 100644
--- a/src/system_queries.cpp
+++ b/src/system_queries.cpp
@@ -27,8 +27,8 @@
 static stdplus::Fd& getIFSock()
 {
     using namespace stdplus::fd;
-    static auto fd = socket(SocketDomain::INet, SocketType::Datagram,
-                            SocketProto::IP);
+    static auto fd =
+        socket(SocketDomain::INet, SocketType::Datagram, SocketProto::IP);
     return fd;
 }
 
@@ -88,8 +88,9 @@
     return optionalIFReq(
                ifname, SIOCETHTOOL, "ETHTOOL"sv,
                [&](const ifreq&) {
-        return EthInfo{.autoneg = edata.autoneg != 0, .speed = edata.speed};
-    },
+                   return EthInfo{.autoneg = edata.autoneg != 0,
+                                  .speed = edata.speed};
+               },
                &edata)
         .value_or(EthInfo{});
 }
@@ -120,16 +121,17 @@
     ifinfomsg msg = {};
     msg.ifi_family = AF_UNSPEC;
     msg.ifi_index = idx;
-    netlink::performRequest(NETLINK_ROUTE, RTM_DELLINK, NLM_F_REPLACE, msg,
-                            [&](const nlmsghdr& hdr, std::string_view data) {
-        int err = 0;
-        if (hdr.nlmsg_type == NLMSG_ERROR)
-        {
-            err = netlink::extractRtData<nlmsgerr>(data).error;
-        }
-        throw std::runtime_error(
-            std::format("Failed to delete `{}`: {}", idx, strerror(err)));
-    });
+    netlink::performRequest(
+        NETLINK_ROUTE, RTM_DELLINK, NLM_F_REPLACE, msg,
+        [&](const nlmsghdr& hdr, std::string_view data) {
+            int err = 0;
+            if (hdr.nlmsg_type == NLMSG_ERROR)
+            {
+                err = netlink::extractRtData<nlmsgerr>(data).error;
+            }
+            throw std::runtime_error(
+                std::format("Failed to delete `{}`: {}", idx, strerror(err)));
+        });
 }
 
 } // namespace phosphor::network::system
diff --git a/test/ibm/hypervisor-network-mgr-test/mock_hyp_sys_config.hpp b/test/ibm/hypervisor-network-mgr-test/mock_hyp_sys_config.hpp
index f44de21..8898b31 100644
--- a/test/ibm/hypervisor-network-mgr-test/mock_hyp_sys_config.hpp
+++ b/test/ibm/hypervisor-network-mgr-test/mock_hyp_sys_config.hpp
@@ -15,8 +15,7 @@
 {
   public:
     MockHypSysConfig(sdbusplus::bus_t& bus, const std::string& objPath,
-                     HypNetworkMgr& parent) :
-        HypSysConfig(bus, objPath, parent)
+                     HypNetworkMgr& parent) : HypSysConfig(bus, objPath, parent)
     {}
 
     void setHostname(std::string hn)
diff --git a/test/mock_syscall.cpp b/test/mock_syscall.cpp
index fa2ae2d..85ea38f 100644
--- a/test/mock_syscall.cpp
+++ b/test/mock_syscall.cpp
@@ -105,8 +105,8 @@
         const auto nlbegin = msgBuf.size();
         msgBuf.append(NLMSG_SPACE(sizeof(ifinfomsg)), '\0');
         {
-            auto& info = *reinterpret_cast<ifinfomsg*>(msgBuf.data() + nlbegin +
-                                                       NLMSG_HDRLEN);
+            auto& info = *reinterpret_cast<ifinfomsg*>(
+                msgBuf.data() + nlbegin + NLMSG_HDRLEN);
             info.ifi_index = i.idx;
             info.ifi_flags = i.flags;
         }
diff --git a/test/test_ethernet_interface.cpp b/test/test_ethernet_interface.cpp
index 27d9b1e..72579f3 100644
--- a/test/test_ethernet_interface.cpp
+++ b/test/test_ethernet_interface.cpp
@@ -39,9 +39,8 @@
 
     {}
 
-    static MockEthernetInterface
-        makeInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
-                      TestManager& manager)
+    static MockEthernetInterface makeInterface(
+        stdplus::PinnedRef<sdbusplus::bus_t> bus, TestManager& manager)
     {
         AllIntfInfo info{InterfaceInfo{
             .type = ARPHRD_ETHER, .idx = 1, .flags = 0, .name = "test0"}};
@@ -76,12 +75,13 @@
     constexpr stdplus::EtherAddr mac{0x11, 0x22, 0x33, 0x44, 0x55, 0x66};
     constexpr unsigned mtu = 150;
 
-    AllIntfInfo info{InterfaceInfo{.type = ARPHRD_ETHER,
-                                   .idx = 2,
-                                   .flags = IFF_RUNNING,
-                                   .name = "test1",
-                                   .mac = mac,
-                                   .mtu = mtu}};
+    AllIntfInfo info{InterfaceInfo{
+        .type = ARPHRD_ETHER,
+        .idx = 2,
+        .flags = IFF_RUNNING,
+        .name = "test1",
+        .mac = mac,
+        .mtu = mtu}};
     MockEthernetInterface intf(bus, manager, info,
                                "/xyz/openbmc_test/network"sv, config::Parser());
 
diff --git a/test/test_network_manager.hpp b/test/test_network_manager.hpp
index e8b9fcc..a9a7985 100644
--- a/test/test_network_manager.hpp
+++ b/test/test_network_manager.hpp
@@ -24,8 +24,8 @@
     {
         EXPECT_CALL(mockReload, setCallback(testing::_))
             .WillOnce([&](fu2::unique_function<void()>&& cb) {
-            reloadCb = std::move(cb);
-        });
+                reloadCb = std::move(cb);
+            });
         return mockReload;
     }
 };
diff --git a/test/test_rtnetlink.cpp b/test/test_rtnetlink.cpp
index 795dcdc..14bec3c 100644
--- a/test/test_rtnetlink.cpp
+++ b/test/test_rtnetlink.cpp
@@ -55,12 +55,13 @@
     msg.mtu_hdr.rta_len = RTA_LENGTH(sizeof(msg.mtu));
 
     auto info = intfFromRtm(stdplus::raw::asView<char>(msg));
-    auto expected = InterfaceInfo{.type = 4,
-                                  .idx = 1,
-                                  .flags = 2,
-                                  .name = "eth0",
-                                  .mac = ether_addr{0, 1, 2, 3, 4, 5},
-                                  .mtu = 50};
+    auto expected = InterfaceInfo{
+        .type = 4,
+        .idx = 1,
+        .flags = 2,
+        .name = "eth0",
+        .mac = ether_addr{0, 1, 2, 3, 4, 5},
+        .mtu = 50};
     EXPECT_EQ(info, expected);
 }
 
