diff --git a/.clang-format b/.clang-format
index d92a3f1..d43e884 100644
--- a/.clang-format
+++ b/.clang-format
@@ -14,26 +14,30 @@
 AllowShortBlocksOnASingleLine: Empty
 AllowShortCaseLabelsOnASingleLine: false
 AllowShortFunctionsOnASingleLine: Empty
-AllowShortIfStatementsOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLambdasOnASingleLine: true
 AllowShortLoopsOnASingleLine: false
 AlwaysBreakAfterReturnType: None
 AlwaysBreakBeforeMultilineStrings: false
 AlwaysBreakTemplateDeclarations: Yes
 BinPackArguments: true
 BinPackParameters: true
+BitFieldColonSpacing: None
 BraceWrapping:
   AfterCaseLabel:  true
   AfterClass:      true
   AfterControlStatement: true
   AfterEnum:       true
+  AfterExternBlock: true
   AfterFunction:   true
   AfterNamespace:  true
   AfterObjCDeclaration: true
   AfterStruct:     true
   AfterUnion:      true
-  AfterExternBlock: true
   BeforeCatch:     true
   BeforeElse:      true
+  BeforeLambdaBody: false
+  BeforeWhile:     false
   IndentBraces:    false
   SplitEmptyFunction:   false
   SplitEmptyRecord:     false
@@ -48,17 +52,16 @@
 ColumnLimit:     80
 CommentPragmas:  '^ IWYU pragma:'
 CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
 ConstructorInitializerIndentWidth: 4
 ContinuationIndentWidth: 4
 Cpp11BracedListStyle: true
-DeriveLineEnding: false
 DerivePointerAlignment: false
-PointerAlignment: Left
 DisableFormat:   false
-ExperimentalAutoDetectBinPacking: false
 FixNamespaceComments: true
-ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
 IncludeBlocks: Regroup
 IncludeCategories:
   - Regex:           '^[<"](gtest|gmock)'
@@ -78,6 +81,7 @@
   - Regex:           '.*'
     Priority:        6
 IndentCaseLabels: true
+IndentExternBlock: NoIndent
 IndentRequiresClause: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
@@ -92,6 +96,7 @@
 ObjCBlockIndentWidth: 2
 ObjCSpaceAfterProperty: false
 ObjCSpaceBeforeProtocolList: true
+PackConstructorInitializers: BinPack
 PenaltyBreakAssignment: 25
 PenaltyBreakBeforeFirstCallParameter: 19
 PenaltyBreakComment: 300
@@ -100,12 +105,13 @@
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
 PenaltyIndentedWhitespace: 0
+PointerAlignment: Left
 QualifierAlignment: Left
 ReferenceAlignment: Left
 ReflowComments:  true
 RequiresClausePosition: OwnLine
 RequiresExpressionIndentation: Keyword
-SortIncludes:    true
+SortIncludes: CaseSensitive
 SortUsingDeclarations: true
 SpaceAfterCStyleCast: false
 SpaceAfterTemplateKeyword: true
@@ -117,7 +123,7 @@
 SpaceBeforeRangeBasedForLoopColon: true
 SpaceInEmptyParentheses: false
 SpacesBeforeTrailingComments: 1
-SpacesInAngles:  false
+SpacesInAngles: Never
 SpacesInContainerLiterals: true
 SpacesInCStyleCastParentheses: false
 SpacesInParentheses: false
diff --git a/http/http2_connection.hpp b/http/http2_connection.hpp
index 4d1bcac..d815119 100644
--- a/http/http2_connection.hpp
+++ b/http/http2_connection.hpp
@@ -519,7 +519,7 @@
             inBuffer.consume(consumed);
 
             doRead();
-            });
+        });
     }
 
     // A mapping from http2 stream ID to Stream Data
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index 2a6afeb..86cc49a 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -486,7 +486,7 @@
             }
 
             doRead();
-            });
+        });
     }
 
     void doRead()
@@ -529,7 +529,7 @@
 
             cancelDeadlineTimer();
             handle();
-            });
+        });
     }
 
     void doWrite(crow::Response& thisRes)
diff --git a/http/http_server.hpp b/http/http_server.hpp
index dbb95b4..b290ad7 100644
--- a/http/http_server.hpp
+++ b/http/http_server.hpp
@@ -188,7 +188,7 @@
                                   [connection] { connection->start(); });
             }
             doAccept();
-            });
+        });
     }
 
   private:
diff --git a/http/routing.hpp b/http/routing.hpp
index 49a51f1..6ab1327 100644
--- a/http/routing.hpp
+++ b/http/routing.hpp
@@ -608,7 +608,7 @@
             [&rule, asyncResp, adaptor(std::forward<Adaptor>(adaptor))](
                 Request& thisReq) mutable {
             rule.handleUpgrade(thisReq, asyncResp, std::move(adaptor));
-            });
+        });
     }
 
     void handle(Request& req,
diff --git a/http/websocket.hpp b/http/websocket.hpp
index 0fda7ee..027ab24 100644
--- a/http/websocket.hpp
+++ b/http/websocket.hpp
@@ -213,7 +213,7 @@
                 BMCWEB_LOG_ERROR("Error closing websocket {}", ec);
                 return;
             }
-            });
+        });
     }
 
     boost::urls::url_view url() override
diff --git a/include/async_resolve.hpp b/include/async_resolve.hpp
index 71d2497..805fbad 100644
--- a/include/async_resolve.hpp
+++ b/include/async_resolve.hpp
@@ -116,7 +116,7 @@
             }
             // All the resolved data is filled in the endpointList
             handler(ec, endpointList);
-            },
+        },
             "org.freedesktop.resolve1", "/org/freedesktop/resolve1",
             "org.freedesktop.resolve1.Manager", "ResolveHostname", 0, host,
             AF_UNSPEC, flag);
diff --git a/include/cors_preflight.hpp b/include/cors_preflight.hpp
index 43e9073..b727222 100644
--- a/include/cors_preflight.hpp
+++ b/include/cors_preflight.hpp
@@ -14,6 +14,6 @@
                const std::shared_ptr<bmcweb::AsyncResp>&, const std::string&) {
         // An empty body handler that simply returns the headers bmcweb
         // uses This allows browsers to do their CORS preflight checks
-        });
+    });
 }
 } // namespace cors_preflight
diff --git a/include/dbus_monitor.hpp b/include/dbus_monitor.hpp
index 2682717..25f0c7f 100644
--- a/include/dbus_monitor.hpp
+++ b/include/dbus_monitor.hpp
@@ -114,141 +114,140 @@
         .privileges({{"Login"}})
         .websocket()
         .onopen([&](crow::websocket::Connection& conn) {
-            BMCWEB_LOG_DEBUG("Connection {} opened", logPtr(&conn));
-            sessions.try_emplace(&conn);
-        })
+        BMCWEB_LOG_DEBUG("Connection {} opened", logPtr(&conn));
+        sessions.try_emplace(&conn);
+    })
         .onclose([&](crow::websocket::Connection& conn, const std::string&) {
-            sessions.erase(&conn);
-        })
+        sessions.erase(&conn);
+    })
         .onmessage([&](crow::websocket::Connection& conn,
                        const std::string& data, bool) {
-            const auto sessionPair = sessions.find(&conn);
-            if (sessionPair == sessions.end())
+        const auto sessionPair = sessions.find(&conn);
+        if (sessionPair == sessions.end())
+        {
+            conn.close("Internal error");
+        }
+        DbusWebsocketSession& thisSession = sessionPair->second;
+        BMCWEB_LOG_DEBUG("Connection {} received {}", logPtr(&conn), data);
+        nlohmann::json j = nlohmann::json::parse(data, nullptr, false);
+        if (j.is_discarded())
+        {
+            BMCWEB_LOG_ERROR("Unable to parse json data for monitor");
+            conn.close("Unable to parse json request");
+            return;
+        }
+        nlohmann::json::iterator interfaces = j.find("interfaces");
+        if (interfaces != j.end())
+        {
+            thisSession.interfaces.reserve(interfaces->size());
+            for (auto& interface : *interfaces)
             {
-                conn.close("Internal error");
+                const std::string* str =
+                    interface.get_ptr<const std::string*>();
+                if (str != nullptr)
+                {
+                    thisSession.interfaces.insert(*str);
+                }
             }
-            DbusWebsocketSession& thisSession = sessionPair->second;
-            BMCWEB_LOG_DEBUG("Connection {} received {}", logPtr(&conn), data);
-            nlohmann::json j = nlohmann::json::parse(data, nullptr, false);
-            if (j.is_discarded())
+        }
+
+        nlohmann::json::iterator paths = j.find("paths");
+        if (paths == j.end())
+        {
+            BMCWEB_LOG_ERROR("Unable to find paths in json data");
+            conn.close("Unable to find paths in json data");
+            return;
+        }
+
+        size_t interfaceCount = thisSession.interfaces.size();
+        if (interfaceCount == 0)
+        {
+            interfaceCount = 1;
+        }
+        // Reserve our matches upfront.  For each path there is 1 for
+        // interfacesAdded, and InterfaceCount number for
+        // PropertiesChanged
+        thisSession.matches.reserve(thisSession.matches.size() +
+                                    paths->size() * (1U + interfaceCount));
+
+        // These regexes derived on the rules here:
+        // https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names
+        static std::regex validPath("^/([A-Za-z0-9_]+/?)*$");
+        static std::regex validInterface(
+            "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)+$");
+
+        for (const auto& thisPath : *paths)
+        {
+            const std::string* thisPathString =
+                thisPath.get_ptr<const std::string*>();
+            if (thisPathString == nullptr)
             {
-                BMCWEB_LOG_ERROR("Unable to parse json data for monitor");
-                conn.close("Unable to parse json request");
+                BMCWEB_LOG_ERROR("subscribe path isn't a string?");
+                conn.close();
                 return;
             }
-            nlohmann::json::iterator interfaces = j.find("interfaces");
-            if (interfaces != j.end())
+            if (!std::regex_match(*thisPathString, validPath))
             {
-                thisSession.interfaces.reserve(interfaces->size());
-                for (auto& interface : *interfaces)
-                {
-                    const std::string* str =
-                        interface.get_ptr<const std::string*>();
-                    if (str != nullptr)
-                    {
-                        thisSession.interfaces.insert(*str);
-                    }
-                }
-            }
-
-            nlohmann::json::iterator paths = j.find("paths");
-            if (paths == j.end())
-            {
-                BMCWEB_LOG_ERROR("Unable to find paths in json data");
-                conn.close("Unable to find paths in json data");
+                BMCWEB_LOG_ERROR("Invalid path name {}", *thisPathString);
+                conn.close();
                 return;
             }
-
-            size_t interfaceCount = thisSession.interfaces.size();
-            if (interfaceCount == 0)
+            std::string propertiesMatchString =
+                ("type='signal',"
+                 "interface='org.freedesktop.DBus.Properties',"
+                 "path_namespace='" +
+                 *thisPathString +
+                 "',"
+                 "member='PropertiesChanged'");
+            // If interfaces weren't specified, add a single match for all
+            // interfaces
+            if (thisSession.interfaces.empty())
             {
-                interfaceCount = 1;
-            }
-            // Reserve our matches upfront.  For each path there is 1 for
-            // interfacesAdded, and InterfaceCount number for
-            // PropertiesChanged
-            thisSession.matches.reserve(thisSession.matches.size() +
-                                        paths->size() * (1U + interfaceCount));
+                BMCWEB_LOG_DEBUG("Creating match {}", propertiesMatchString);
 
-            // These regexes derived on the rules here:
-            // https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names
-            static std::regex validPath("^/([A-Za-z0-9_]+/?)*$");
-            static std::regex validInterface(
-                "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)+$");
-
-            for (const auto& thisPath : *paths)
-            {
-                const std::string* thisPathString =
-                    thisPath.get_ptr<const std::string*>();
-                if (thisPathString == nullptr)
-                {
-                    BMCWEB_LOG_ERROR("subscribe path isn't a string?");
-                    conn.close();
-                    return;
-                }
-                if (!std::regex_match(*thisPathString, validPath))
-                {
-                    BMCWEB_LOG_ERROR("Invalid path name {}", *thisPathString);
-                    conn.close();
-                    return;
-                }
-                std::string propertiesMatchString =
-                    ("type='signal',"
-                     "interface='org.freedesktop.DBus.Properties',"
-                     "path_namespace='" +
-                     *thisPathString +
-                     "',"
-                     "member='PropertiesChanged'");
-                // If interfaces weren't specified, add a single match for all
-                // interfaces
-                if (thisSession.interfaces.empty())
-                {
-                    BMCWEB_LOG_DEBUG("Creating match {}",
-                                     propertiesMatchString);
-
-                    thisSession.matches.emplace_back(
-                        std::make_unique<sdbusplus::bus::match_t>(
-                            *crow::connections::systemBus,
-                            propertiesMatchString, onPropertyUpdate, &conn));
-                }
-                else
-                {
-                    // If interfaces were specified, add a match for each
-                    // interface
-                    for (const std::string& interface : thisSession.interfaces)
-                    {
-                        if (!std::regex_match(interface, validInterface))
-                        {
-                            BMCWEB_LOG_ERROR("Invalid interface name {}",
-                                             interface);
-                            conn.close();
-                            return;
-                        }
-                        std::string ifaceMatchString = propertiesMatchString;
-                        ifaceMatchString += ",arg0='";
-                        ifaceMatchString += interface;
-                        ifaceMatchString += "'";
-                        BMCWEB_LOG_DEBUG("Creating match {}", ifaceMatchString);
-                        thisSession.matches.emplace_back(
-                            std::make_unique<sdbusplus::bus::match_t>(
-                                *crow::connections::systemBus, ifaceMatchString,
-                                onPropertyUpdate, &conn));
-                    }
-                }
-                std::string objectManagerMatchString =
-                    ("type='signal',"
-                     "interface='org.freedesktop.DBus.ObjectManager',"
-                     "path_namespace='" +
-                     *thisPathString +
-                     "',"
-                     "member='InterfacesAdded'");
-                BMCWEB_LOG_DEBUG("Creating match {}", objectManagerMatchString);
                 thisSession.matches.emplace_back(
                     std::make_unique<sdbusplus::bus::match_t>(
-                        *crow::connections::systemBus, objectManagerMatchString,
+                        *crow::connections::systemBus, propertiesMatchString,
                         onPropertyUpdate, &conn));
             }
-        });
+            else
+            {
+                // If interfaces were specified, add a match for each
+                // interface
+                for (const std::string& interface : thisSession.interfaces)
+                {
+                    if (!std::regex_match(interface, validInterface))
+                    {
+                        BMCWEB_LOG_ERROR("Invalid interface name {}",
+                                         interface);
+                        conn.close();
+                        return;
+                    }
+                    std::string ifaceMatchString = propertiesMatchString;
+                    ifaceMatchString += ",arg0='";
+                    ifaceMatchString += interface;
+                    ifaceMatchString += "'";
+                    BMCWEB_LOG_DEBUG("Creating match {}", ifaceMatchString);
+                    thisSession.matches.emplace_back(
+                        std::make_unique<sdbusplus::bus::match_t>(
+                            *crow::connections::systemBus, ifaceMatchString,
+                            onPropertyUpdate, &conn));
+                }
+            }
+            std::string objectManagerMatchString =
+                ("type='signal',"
+                 "interface='org.freedesktop.DBus.ObjectManager',"
+                 "path_namespace='" +
+                 *thisPathString +
+                 "',"
+                 "member='InterfacesAdded'");
+            BMCWEB_LOG_DEBUG("Creating match {}", objectManagerMatchString);
+            thisSession.matches.emplace_back(
+                std::make_unique<sdbusplus::bus::match_t>(
+                    *crow::connections::systemBus, objectManagerMatchString,
+                    onPropertyUpdate, &conn));
+        }
+    });
 }
 } // namespace dbus_monitor
 } // namespace crow
diff --git a/include/dbus_privileges.hpp b/include/dbus_privileges.hpp
index 7fb545a..16aae5e 100644
--- a/include/dbus_privileges.hpp
+++ b/include/dbus_privileges.hpp
@@ -181,7 +181,7 @@
             const dbus::utility::DBusPropertiesMap& userInfoMap) mutable {
         afterGetUserInfo(req, asyncResp, rule,
                          std::forward<CallbackFn>(callback), ec, userInfoMap);
-        },
+    },
         "xyz.openbmc_project.User.Manager", "/xyz/openbmc_project/user",
         "xyz.openbmc_project.User.Manager", "GetUserInfo", username);
 }
diff --git a/include/dbus_utility.hpp b/include/dbus_utility.hpp
index a8eefd5..933d733 100644
--- a/include/dbus_utility.hpp
+++ b/include/dbus_utility.hpp
@@ -151,7 +151,7 @@
             const boost::system::error_code& ec,
             const dbus::utility::MapperGetObject& objectNames) {
         callback(!ec && !objectNames.empty());
-        },
+    },
         "xyz.openbmc_project.ObjectMapper",
         "/xyz/openbmc_project/object_mapper",
         "xyz.openbmc_project.ObjectMapper", "GetObject", path,
@@ -185,7 +185,7 @@
             const boost::system::error_code& ec,
             const MapperGetSubTreePathsResponse& subtreePaths) {
         callback(ec, subtreePaths);
-        },
+    },
         "xyz.openbmc_project.ObjectMapper",
         "/xyz/openbmc_project/object_mapper",
         "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths", path, depth,
@@ -221,7 +221,7 @@
             const boost::system::error_code& ec,
             const MapperGetSubTreePathsResponse& subtreePaths) {
         callback(ec, subtreePaths);
-        },
+    },
         "xyz.openbmc_project.ObjectMapper",
         "/xyz/openbmc_project/object_mapper",
         "xyz.openbmc_project.ObjectMapper", "GetAssociatedSubTreePaths",
@@ -238,7 +238,7 @@
         [callback{std::move(callback)}](const boost::system::error_code& ec,
                                         const MapperGetObject& object) {
         callback(ec, object);
-        },
+    },
         "xyz.openbmc_project.ObjectMapper",
         "/xyz/openbmc_project/object_mapper",
         "xyz.openbmc_project.ObjectMapper", "GetObject", path, interfaces);
@@ -264,7 +264,7 @@
         [callback{std::move(callback)}](const boost::system::error_code& ec,
                                         const ManagedObjectType& objects) {
         callback(ec, objects);
-        },
+    },
         service, path, "org.freedesktop.DBus.ObjectManager",
         "GetManagedObjects");
 }
diff --git a/include/google/google_service_root.hpp b/include/google/google_service_root.hpp
index bb51490..9dd2405 100644
--- a/include/google/google_service_root.hpp
+++ b/include/google/google_service_root.hpp
@@ -110,7 +110,7 @@
             const dbus::utility::MapperGetSubTreeResponse& subtree) {
         hothGetSubtreeCallback(command, asyncResp, rotId, entityHandler, ec,
                                subtree);
-        });
+    });
 }
 
 inline void populateRootOfTrustEntity(
@@ -181,7 +181,7 @@
         [asyncResp{asyncResp}](const boost::system::error_code& ec,
                                const std::vector<uint8_t>& responseBytes) {
         invocationCallback(asyncResp, ec, responseBytes);
-        },
+    },
         resolvedEntity.service, resolvedEntity.object, resolvedEntity.interface,
         "SendHostCommand", bytes);
 }
diff --git a/include/hostname_monitor.hpp b/include/hostname_monitor.hpp
index f1a0d3d..6339a6b 100644
--- a/include/hostname_monitor.hpp
+++ b/include/hostname_monitor.hpp
@@ -29,7 +29,7 @@
         BMCWEB_LOG_INFO("Replace HTTPs Certificate Success, "
                         "remove temporary certificate file..");
         remove(certPath.c_str());
-        },
+    },
         "xyz.openbmc_project.Certs.Manager.Server.Https",
         "/xyz/openbmc_project/certs/server/https/1",
         "xyz.openbmc_project.Certs.Replace", "Replace", certPath.string());
diff --git a/include/http_utility.hpp b/include/http_utility.hpp
index 2fd5e14..4f430ae 100644
--- a/include/http_utility.hpp
+++ b/include/http_utility.hpp
@@ -78,8 +78,8 @@
         }
         const auto* knownContentType = std::ranges::find_if(
             contentTypes, [encoding](const ContentTypePair& pair) {
-                return pair.contentTypeString == encoding;
-            });
+            return pair.contentTypeString == encoding;
+        });
 
         if (knownContentType == contentTypes.end())
         {
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index b87cb1e..fd1e2a5 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -695,7 +695,7 @@
             "/ibm/v1/HMC/LockService";
         asyncResp->res.jsonValue["BroadcastService"]["@odata.id"] =
             "/ibm/v1/HMC/BroadcastService";
-        });
+    });
 
     BMCWEB_ROUTE(app, "/ibm/v1/Host/ConfigFiles")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
@@ -703,7 +703,7 @@
             [](const crow::Request&,
                const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
         handleConfigFileList(asyncResp);
-        });
+    });
 
     BMCWEB_ROUTE(app,
                  "/ibm/v1/Host/ConfigFiles/Actions/IBMConfigFiles.DeleteAll")
@@ -712,7 +712,7 @@
             [](const crow::Request&,
                const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
         deleteConfigFiles(asyncResp);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/ibm/v1/Host/ConfigFiles/<str>")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
@@ -729,7 +729,7 @@
             return;
         }
         handleFileUrl(req, asyncResp, fileName);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/ibm/v1/HMC/LockService")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
@@ -737,7 +737,7 @@
             [](const crow::Request&,
                const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
         getLockServiceData(asyncResp);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/ibm/v1/HMC/LockService/Actions/LockService.AcquireLock")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
@@ -753,7 +753,7 @@
             return;
         }
         handleAcquireLockAPI(req, asyncResp, body);
-        });
+    });
     BMCWEB_ROUTE(app, "/ibm/v1/HMC/LockService/Actions/LockService.ReleaseLock")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
         .methods(boost::beast::http::verb::post)(
@@ -783,7 +783,7 @@
             redfish::messages::propertyValueNotInList(asyncResp->res, type,
                                                       "Type");
         }
-        });
+    });
     BMCWEB_ROUTE(app, "/ibm/v1/HMC/LockService/Actions/LockService.GetLockList")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
         .methods(boost::beast::http::verb::post)(
@@ -798,7 +798,7 @@
             return;
         }
         handleGetLockListAPI(asyncResp, listSessionIds);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/ibm/v1/HMC/BroadcastService")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
@@ -806,7 +806,7 @@
             [](const crow::Request& req,
                const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
         handleBroadcastService(req, asyncResp);
-        });
+    });
 }
 
 } // namespace ibm_mc
diff --git a/include/image_upload.hpp b/include/image_upload.hpp
index f5c8110..ef615cb 100644
--- a/include/image_upload.hpp
+++ b/include/image_upload.hpp
@@ -68,8 +68,8 @@
         m.read(path, interfaces);
 
         if (std::ranges::find_if(interfaces, [](const auto& i) {
-                return i.first == "xyz.openbmc_project.Software.Version";
-            }) != interfaces.end())
+            return i.first == "xyz.openbmc_project.Software.Version";
+        }) != interfaces.end())
         {
             timeout.cancel();
             std::string leaf = path.filename();
@@ -115,7 +115,7 @@
             [](const crow::Request& req,
                const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
         uploadImageHandler(req, asyncResp);
-        });
+    });
 }
 } // namespace image_upload
 } // namespace crow
diff --git a/include/kvm_websocket.hpp b/include/kvm_websocket.hpp
index d04c19f..0089ae3 100644
--- a/include/kvm_websocket.hpp
+++ b/include/kvm_websocket.hpp
@@ -24,20 +24,20 @@
             boost::asio::ip::make_address("127.0.0.1"), 5900);
         hostSocket.async_connect(
             endpoint, [this, &connIn](const boost::system::error_code& ec) {
-                if (ec)
+            if (ec)
+            {
+                BMCWEB_LOG_ERROR(
+                    "conn:{}, Couldn't connect to KVM socket port: {}",
+                    logPtr(&conn), ec);
+                if (ec != boost::asio::error::operation_aborted)
                 {
-                    BMCWEB_LOG_ERROR(
-                        "conn:{}, Couldn't connect to KVM socket port: {}",
-                        logPtr(&conn), ec);
-                    if (ec != boost::asio::error::operation_aborted)
-                    {
-                        connIn.close("Error in connecting to KVM port");
-                    }
-                    return;
+                    connIn.close("Error in connecting to KVM port");
                 }
+                return;
+            }
 
-                doRead();
-            });
+            doRead();
+        });
     }
 
     void onMessage(const std::string& data)
@@ -102,7 +102,7 @@
             outputBuffer.consume(bytesRead);
 
             doRead();
-            });
+        });
     }
 
     void doWrite()
@@ -152,7 +152,7 @@
             }
 
             doWrite();
-            });
+        });
     }
 
     crow::websocket::Connection& conn;
@@ -175,26 +175,26 @@
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
         .websocket()
         .onopen([](crow::websocket::Connection& conn) {
-            BMCWEB_LOG_DEBUG("Connection {} opened", logPtr(&conn));
+        BMCWEB_LOG_DEBUG("Connection {} opened", logPtr(&conn));
 
-            if (sessions.size() == maxSessions)
-            {
-                conn.close("Max sessions are already connected");
-                return;
-            }
+        if (sessions.size() == maxSessions)
+        {
+            conn.close("Max sessions are already connected");
+            return;
+        }
 
-            sessions[&conn] = std::make_shared<KvmSession>(conn);
-        })
+        sessions[&conn] = std::make_shared<KvmSession>(conn);
+    })
         .onclose([](crow::websocket::Connection& conn, const std::string&) {
-            sessions.erase(&conn);
-        })
+        sessions.erase(&conn);
+    })
         .onmessage([](crow::websocket::Connection& conn,
                       const std::string& data, bool) {
-            if (sessions[&conn])
-            {
-                sessions[&conn]->onMessage(data);
-            }
-        });
+        if (sessions[&conn])
+        {
+            sessions[&conn]->onMessage(data);
+        }
+    });
 }
 
 } // namespace obmc_kvm
diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp
index 5540886..17d57b4 100644
--- a/include/nbd_proxy.hpp
+++ b/include/nbd_proxy.hpp
@@ -164,8 +164,8 @@
                     self2->ux2wsBuf.consume(self2->ux2wsBuf.size());
                     self2->doRead();
                 }
-                });
             });
+        });
     }
 
     void doWrite(std::function<void()>&& onDone)
@@ -211,7 +211,7 @@
                 return;
             }
             onDone();
-            });
+        });
     }
 
     // Keeps UNIX socket endpoint file path
@@ -332,7 +332,7 @@
         [&conn](const boost::system::error_code& ec,
                 const dbus::utility::ManagedObjectType& objects) {
         afterGetManagedObjects(conn, ec, objects);
-        });
+    });
 
     // We need to wait for dbus and the websockets to hook up before data is
     // sent/received.  Tell the core to hold off messages until the sockets are
diff --git a/include/obmc_console.hpp b/include/obmc_console.hpp
index 2dd3edb..fb363be 100644
--- a/include/obmc_console.hpp
+++ b/include/obmc_console.hpp
@@ -71,7 +71,7 @@
                 return;
             }
             self->doWrite();
-            });
+        });
     }
 
     static void afterSendEx(const std::weak_ptr<ConsoleHandler>& weak)
@@ -107,7 +107,7 @@
             std::string_view payload(outputBuffer.data(), bytesRead);
             self->conn.sendEx(crow::websocket::MessageType::Binary, payload,
                               std::bind_front(afterSendEx, weak_from_this()));
-            });
+        });
     }
 
     bool connect(int fd)
@@ -247,7 +247,7 @@
         [&conn](const boost::system::error_code& ec1,
                 const sdbusplus::message::unix_fd& unixfd) {
         connectConsoleSocket(conn, ec1, unixfd);
-        },
+    },
         consoleService, consoleObjPath, "xyz.openbmc_project.Console.Access",
         "Connect");
 }
@@ -299,7 +299,7 @@
         [&conn, consolePath](const boost::system::error_code& ec,
                              const ::dbus::utility::MapperGetObject& objInfo) {
         processConsoleObject(conn, consolePath, ec, objInfo);
-        });
+    });
 }
 
 inline void onMessage(crow::websocket::Connection& conn,
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 7c47bcc..bade59e 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -176,7 +176,7 @@
                 node = node->NextSiblingElement("node");
             }
         }
-        },
+    },
         processName, objectPath, "org.freedesktop.DBus.Introspectable",
         "Introspect");
 }
@@ -223,10 +223,10 @@
                 {
                     propertyJson = val;
                 }
-                },
+            },
                 value);
         }
-        });
+    });
 }
 
 // Find any results that weren't picked up by ObjectManagers, to be
@@ -347,7 +347,7 @@
                             {
                                 propertyJson = val;
                             }
-                            },
+                        },
                             property.second);
                     }
                 }
@@ -362,7 +362,7 @@
                 }
             }
         }
-        });
+    });
 }
 
 inline void findObjectManagerPathForEnumerate(
@@ -395,7 +395,7 @@
                 }
             }
         }
-        },
+    },
         "xyz.openbmc_project.ObjectMapper",
         "/xyz/openbmc_project/object_mapper",
         "xyz.openbmc_project.ObjectMapper", "GetAncestors", objectName,
@@ -469,7 +469,7 @@
                     transaction->objectPath, connection.first, transaction);
             }
         }
-        });
+    });
 }
 
 // Structure for storing data on an in progress action
@@ -1487,10 +1487,9 @@
                         }
 
                         crow::connections::systemBus->async_send(
-                            m,
-                            [transaction,
-                             returnType](const boost::system::error_code& ec2,
-                                         sdbusplus::message_t& m2) {
+                            m, [transaction, returnType](
+                                   const boost::system::error_code& ec2,
+                                   sdbusplus::message_t& m2) {
                             if (ec2)
                             {
                                 transaction->methodFailed = true;
@@ -1515,7 +1514,7 @@
                             transaction->methodPassed = true;
 
                             handleMethodResponse(transaction, m2, returnType);
-                            });
+                        });
                         break;
                     }
                     methodNode = methodNode->NextSiblingElement("method");
@@ -1523,7 +1522,7 @@
             }
             interfaceNode = interfaceNode->NextSiblingElement("interface");
         }
-        },
+    },
         connectionName, transaction->path,
         "org.freedesktop.DBus.Introspectable", "Introspect");
 }
@@ -1596,7 +1595,7 @@
         {
             findActionOnInterface(transaction, object.first);
         }
-        });
+    });
 }
 
 inline void handleDelete(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -1629,7 +1628,7 @@
         {
             findActionOnInterface(transaction, object.first);
         }
-        });
+    });
 }
 
 inline void handleList(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -1652,7 +1651,7 @@
             asyncResp->res.jsonValue["message"] = "200 OK";
             asyncResp->res.jsonValue["data"] = objectPaths;
         }
-        });
+    });
 }
 
 inline void handleEnumerate(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -1689,7 +1688,7 @@
         // Add the data for the path passed in to the results
         // as if GetSubTree returned it, and continue on enumerating
         getObjectAndEnumerate(transaction);
-        });
+    });
 }
 
 inline void handleGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -1742,58 +1741,58 @@
                     m, [asyncResp, response,
                         propertyName](const boost::system::error_code& ec2,
                                       sdbusplus::message_t& msg) {
-                        if (ec2)
+                    if (ec2)
+                    {
+                        BMCWEB_LOG_ERROR("Bad dbus request error: {}", ec2);
+                    }
+                    else
+                    {
+                        nlohmann::json properties;
+                        int r = convertDBusToJSON("a{sv}", msg, properties);
+                        if (r < 0)
                         {
-                            BMCWEB_LOG_ERROR("Bad dbus request error: {}", ec2);
+                            BMCWEB_LOG_ERROR("convertDBusToJSON failed");
                         }
                         else
                         {
-                            nlohmann::json properties;
-                            int r = convertDBusToJSON("a{sv}", msg, properties);
-                            if (r < 0)
+                            for (const auto& prop : properties.items())
                             {
-                                BMCWEB_LOG_ERROR("convertDBusToJSON failed");
-                            }
-                            else
-                            {
-                                for (const auto& prop : properties.items())
-                                {
-                                    // if property name is empty, or
-                                    // matches our search query, add it
-                                    // to the response json
+                                // if property name is empty, or
+                                // matches our search query, add it
+                                // to the response json
 
-                                    if (propertyName->empty())
-                                    {
-                                        (*response)[prop.key()] =
-                                            std::move(prop.value());
-                                    }
-                                    else if (prop.key() == *propertyName)
-                                    {
-                                        *response = std::move(prop.value());
-                                    }
+                                if (propertyName->empty())
+                                {
+                                    (*response)[prop.key()] =
+                                        std::move(prop.value());
+                                }
+                                else if (prop.key() == *propertyName)
+                                {
+                                    *response = std::move(prop.value());
                                 }
                             }
                         }
-                        if (response.use_count() == 1)
+                    }
+                    if (response.use_count() == 1)
+                    {
+                        if (!propertyName->empty() && response->empty())
                         {
-                            if (!propertyName->empty() && response->empty())
-                            {
-                                setErrorResponse(
-                                    asyncResp->res,
-                                    boost::beast::http::status::not_found,
-                                    propNotFoundDesc, notFoundMsg);
-                            }
-                            else
-                            {
-                                asyncResp->res.jsonValue["status"] = "ok";
-                                asyncResp->res.jsonValue["message"] = "200 OK";
-                                asyncResp->res.jsonValue["data"] = *response;
-                            }
+                            setErrorResponse(
+                                asyncResp->res,
+                                boost::beast::http::status::not_found,
+                                propNotFoundDesc, notFoundMsg);
                         }
-                    });
+                        else
+                        {
+                            asyncResp->res.jsonValue["status"] = "ok";
+                            asyncResp->res.jsonValue["message"] = "200 OK";
+                            asyncResp->res.jsonValue["data"] = *response;
+                        }
+                    }
+                });
             }
         }
-        });
+    });
 }
 
 struct AsyncPutRequest
@@ -1975,10 +1974,9 @@
                                     return;
                                 }
                                 crow::connections::systemBus->async_send(
-                                    m,
-                                    [transaction](
-                                        const boost::system::error_code& ec,
-                                        sdbusplus::message_t& m2) {
+                                    m, [transaction](
+                                           const boost::system::error_code& ec,
+                                           sdbusplus::message_t& m2) {
                                     BMCWEB_LOG_DEBUG("sent");
                                     if (ec)
                                     {
@@ -2002,18 +2000,18 @@
                                         transaction->asyncResp->res
                                             .jsonValue["data"] = nullptr;
                                     }
-                                    });
+                                });
                             }
                         }
                         propNode = propNode->NextSiblingElement("property");
                     }
                     ifaceNode = ifaceNode->NextSiblingElement("interface");
                 }
-                },
+            },
                 connectionName, transaction->objectPath,
                 "org.freedesktop.DBus.Introspectable", "Introspect");
         }
-        });
+    });
 }
 
 inline void handleDBusUrl(const crow::Request& req,
@@ -2195,7 +2193,7 @@
 
                 interface = interface->NextSiblingElement("interface");
             }
-            },
+        },
             processName, objectPath, "org.freedesktop.DBus.Introspectable",
             "Introspect");
     }
@@ -2361,17 +2359,17 @@
                         m, [&propertyItem,
                             asyncResp](const boost::system::error_code& ec2,
                                        sdbusplus::message_t& msg) {
-                            if (ec2)
-                            {
-                                return;
-                            }
+                        if (ec2)
+                        {
+                            return;
+                        }
 
-                            convertDBusToJSON("v", msg, propertyItem);
-                        });
+                        convertDBusToJSON("v", msg, propertyItem);
+                    });
                 }
                 property = property->NextSiblingElement("property");
             }
-            },
+        },
             processName, objectPath, "org.freedesktop.DBus.Introspectable",
             "Introspect");
     }
@@ -2427,7 +2425,7 @@
         bus["name"] = "system";
         asyncResp->res.jsonValue["busses"] = std::move(buses);
         asyncResp->res.jsonValue["status"] = "ok";
-        });
+    });
 
     BMCWEB_ROUTE(app, "/bus/system/")
         .privileges({{"Login"}})
@@ -2458,7 +2456,7 @@
         crow::connections::systemBus->async_method_call(
             std::move(myCallback), "org.freedesktop.DBus", "/",
             "org.freedesktop.DBus", "ListNames");
-        });
+    });
 
     BMCWEB_ROUTE(app, "/list/")
         .privileges({{"Login"}})
@@ -2466,7 +2464,7 @@
             [](const crow::Request&,
                const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
         handleList(asyncResp, "/");
-        });
+    });
 
     BMCWEB_ROUTE(app, "/xyz/<path>")
         .privileges({{"Login"}})
@@ -2476,7 +2474,7 @@
                const std::string& path) {
         std::string objectPath = "/xyz/" + path;
         handleDBusUrl(req, asyncResp, objectPath);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/xyz/<path>")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
@@ -2487,7 +2485,7 @@
                const std::string& path) {
         std::string objectPath = "/xyz/" + path;
         handleDBusUrl(req, asyncResp, objectPath);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/org/<path>")
         .privileges({{"Login"}})
@@ -2497,7 +2495,7 @@
                const std::string& path) {
         std::string objectPath = "/org/" + path;
         handleDBusUrl(req, asyncResp, objectPath);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/org/<path>")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
@@ -2508,7 +2506,7 @@
                const std::string& path) {
         std::string objectPath = "/org/" + path;
         handleDBusUrl(req, asyncResp, objectPath);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/download/dump/<str>/")
         .privileges({{"ConfigureManager"}})
@@ -2572,7 +2570,7 @@
         }
         asyncResp->res.result(boost::beast::http::status::not_found);
         return;
-        });
+    });
 
     BMCWEB_ROUTE(app, "/bus/system/<str>/")
         .privileges({{"Login"}})
@@ -2582,7 +2580,7 @@
                const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                const std::string& connection) {
         introspectObjects(connection, "/", asyncResp);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/bus/system/<str>/<path>")
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
diff --git a/include/vm_websocket.hpp b/include/vm_websocket.hpp
index a8d6a14..13bbdc6 100644
--- a/include/vm_websocket.hpp
+++ b/include/vm_websocket.hpp
@@ -111,7 +111,7 @@
                 return;
             }
             doWrite();
-            });
+        });
     }
 
     void doRead()
@@ -145,7 +145,7 @@
             outputBuffer->consume(bytesRead);
 
             doRead();
-            });
+        });
     }
 
     boost::process::async_pipe pipeOut;
@@ -169,57 +169,57 @@
         .privileges({{"ConfigureComponents", "ConfigureManager"}})
         .websocket()
         .onopen([](crow::websocket::Connection& conn) {
-            BMCWEB_LOG_DEBUG("Connection {} opened", logPtr(&conn));
+        BMCWEB_LOG_DEBUG("Connection {} opened", logPtr(&conn));
 
-            if (session != nullptr)
-            {
-                conn.close("Session already connected");
-                return;
-            }
+        if (session != nullptr)
+        {
+            conn.close("Session already connected");
+            return;
+        }
 
-            if (handler != nullptr)
-            {
-                conn.close("Handler already running");
-                return;
-            }
+        if (handler != nullptr)
+        {
+            conn.close("Handler already running");
+            return;
+        }
 
-            session = &conn;
+        session = &conn;
 
-            // media is the last digit of the endpoint /vm/0/0. A future
-            // enhancement can include supporting different endpoint values.
-            const char* media = "0";
-            handler = std::make_shared<Handler>(media, conn.getIoContext());
-            handler->connect();
-        })
+        // media is the last digit of the endpoint /vm/0/0. A future
+        // enhancement can include supporting different endpoint values.
+        const char* media = "0";
+        handler = std::make_shared<Handler>(media, conn.getIoContext());
+        handler->connect();
+    })
         .onclose([](crow::websocket::Connection& conn,
                     const std::string& /*reason*/) {
-            if (&conn != session)
-            {
-                return;
-            }
+        if (&conn != session)
+        {
+            return;
+        }
 
-            session = nullptr;
-            handler->doClose();
-            handler->inputBuffer->clear();
-            handler->outputBuffer->clear();
-            handler.reset();
-        })
+        session = nullptr;
+        handler->doClose();
+        handler->inputBuffer->clear();
+        handler->outputBuffer->clear();
+        handler.reset();
+    })
         .onmessage([](crow::websocket::Connection& conn,
                       const std::string& data, bool) {
-            if (data.length() >
-                handler->inputBuffer->capacity() - handler->inputBuffer->size())
-            {
-                BMCWEB_LOG_ERROR("Buffer overrun when writing {} bytes",
-                                 data.length());
-                conn.close("Buffer overrun");
-                return;
-            }
+        if (data.length() >
+            handler->inputBuffer->capacity() - handler->inputBuffer->size())
+        {
+            BMCWEB_LOG_ERROR("Buffer overrun when writing {} bytes",
+                             data.length());
+            conn.close("Buffer overrun");
+            return;
+        }
 
-            boost::asio::buffer_copy(handler->inputBuffer->prepare(data.size()),
-                                     boost::asio::buffer(data));
-            handler->inputBuffer->commit(data.size());
-            handler->doWrite();
-        });
+        boost::asio::buffer_copy(handler->inputBuffer->prepare(data.size()),
+                                 boost::asio::buffer(data));
+        handler->inputBuffer->commit(data.size());
+        handler->doWrite();
+    });
 }
 
 } // namespace obmc_vm
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 5ea30df..acdb00e 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -86,8 +86,8 @@
 {
     std::span<const MessageEntry>::iterator messageIt = std::ranges::find_if(
         registry, [&messageKey](const MessageEntry& messageEntry) {
-            return messageKey == messageEntry.first;
-        });
+        return messageKey == messageEntry.first;
+    });
     if (messageIt != registry.end())
     {
         return &messageIt->second;
@@ -989,7 +989,7 @@
             [](const std::pair<std::string, std::shared_ptr<Subscription>>&
                    entry) {
             return (entry.second->subscriptionType == subscriptionTypeSSE);
-            });
+        });
         return static_cast<size_t>(size);
     }
 
diff --git a/redfish-core/include/redfish_aggregator.hpp b/redfish-core/include/redfish_aggregator.hpp
index 5df43a6..335c64e 100644
--- a/redfish-core/include/redfish_aggregator.hpp
+++ b/redfish-core/include/redfish_aggregator.hpp
@@ -848,7 +848,7 @@
                     "No satellite BMCs detected.  Redfish Aggregation not enabled");
             }
             handler(ec, satelliteInfo);
-            });
+        });
     }
 
     // Processes the response returned by a satellite BMC and loads its
diff --git a/redfish-core/include/snmp_trap_event_clients.hpp b/redfish-core/include/snmp_trap_event_clients.hpp
index de7bf9d..5660fbc 100644
--- a/redfish-core/include/snmp_trap_event_clients.hpp
+++ b/redfish-core/include/snmp_trap_event_clients.hpp
@@ -83,7 +83,7 @@
         [asyncResp](const boost::system::error_code& ec,
                     const dbus::utility::DBusPropertiesMap& properties) {
         afterGetSnmpTrapClientdata(asyncResp, ec, properties);
-        });
+    });
 }
 
 inline void
@@ -123,7 +123,7 @@
 
         messages::resourceNotFound(asyncResp->res, "Subscriptions", id);
         EventServiceManager::getInstance().deleteSubscription(id);
-        },
+    },
         "xyz.openbmc_project.Network.SNMP",
         "/xyz/openbmc_project/network/snmp/manager",
         "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
@@ -171,7 +171,7 @@
         [asyncResp](const boost::system::error_code& ec,
                     const std::string& dbusSNMPid) {
         afterSnmpClientCreate(asyncResp, ec, dbusSNMPid);
-        },
+    },
         "xyz.openbmc_project.Network.SNMP",
         "/xyz/openbmc_project/network/snmp/manager",
         "xyz.openbmc_project.Network.Client.Create", "Client", host,
@@ -224,7 +224,7 @@
             return;
         }
         messages::success(asyncResp->res);
-        },
+    },
         "xyz.openbmc_project.Network.SNMP", static_cast<std::string>(snmpPath),
         "xyz.openbmc_project.Object.Delete", "Delete");
 }
diff --git a/redfish-core/include/utils/chassis_utils.hpp b/redfish-core/include/utils/chassis_utils.hpp
index c8c203d..6d1f8d1 100644
--- a/redfish-core/include/utils/chassis_utils.hpp
+++ b/redfish-core/include/utils/chassis_utils.hpp
@@ -59,7 +59,7 @@
             }
         }
         callback(chassisPath);
-        });
+    });
     BMCWEB_LOG_DEBUG("checkChassisId exit");
 }
 
diff --git a/redfish-core/include/utils/json_utils.hpp b/redfish-core/include/utils/json_utils.hpp
index f4e5385..82f1fe2 100644
--- a/redfish-core/include/utils/json_utils.hpp
+++ b/redfish-core/include/utils/json_utils.hpp
@@ -452,9 +452,9 @@
                     std::remove_pointer_t<std::decay_t<decltype(val)>>;
                 return details::unpackValue<ContainedT>(
                     item.second, unpackSpec.key, res, *val);
-                         },
+            },
                          unpackSpec.value) &&
-                result;
+                     result;
 
             unpackSpec.complete = true;
             break;
@@ -476,7 +476,7 @@
                 using ContainedType =
                     std::remove_pointer_t<std::decay_t<decltype(val)>>;
                 return details::IsOptional<ContainedType>::value;
-                },
+            },
                 perUnpack.value);
             if (isOptional)
             {
diff --git a/redfish-core/include/utils/pcie_util.hpp b/redfish-core/include/utils/pcie_util.hpp
index a889f93..1a9d2bb 100644
--- a/redfish-core/include/utils/pcie_util.hpp
+++ b/redfish-core/include/utils/pcie_util.hpp
@@ -71,7 +71,7 @@
             pcieDeviceList.emplace_back(std::move(pcieDevice));
         }
         asyncResp->res.jsonValue[name + "@odata.count"] = pcieDeviceList.size();
-        });
+    });
 }
 
 inline std::optional<pcie_slots::SlotTypes>
diff --git a/redfish-core/include/utils/sw_utils.hpp b/redfish-core/include/utils/sw_utils.hpp
index 4e1e066..8a715e6 100644
--- a/redfish-core/include/utils/sw_utils.hpp
+++ b/redfish-core/include/utils/sw_utils.hpp
@@ -223,10 +223,10 @@
                         asyncResp->res.jsonValue[activeVersionPropName] =
                             *version;
                     }
-                    });
+                });
             }
-            });
         });
+    });
 }
 
 /**
@@ -337,7 +337,7 @@
             getRedfishSwState(*swInvActivation);
         asyncResp->res.jsonValue["Status"]["Health"] =
             getRedfishSwHealth(*swInvActivation);
-        });
+    });
 }
 
 /**
@@ -373,7 +373,7 @@
             asyncResp->res.jsonValue["Updateable"] = true;
             return;
         }
-        });
+    });
 }
 
 } // namespace sw_util
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 70a1506..a6b8c49 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -263,14 +263,14 @@
         *crow::connections::systemBus, "xyz.openbmc_project.User.Manager",
         dbusObjectPath, "xyz.openbmc_project.User.Attributes", "UserGroups",
         updatedUserGroups, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            messages::success(asyncResp->res);
-        });
+        if (ec)
+        {
+            BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
+            messages::internalError(asyncResp->res);
+            return;
+        }
+        messages::success(asyncResp->res);
+    });
 }
 
 inline void userErrorMessageHandler(
@@ -383,7 +383,7 @@
                     }
                     asyncResp->res.jsonValue[serverType]["RemoteRoleMapping"]
                                             [index] = nullptr;
-                    },
+                },
                     ldapDbusService, roleMapObjData[index].first,
                     "xyz.openbmc_project.Object.Delete", "Delete");
             }
@@ -453,7 +453,7 @@
                         asyncResp->res
                             .jsonValue[serverType]["RemoteRoleMapping"][index]
                                       ["RemoteGroup"] = *remoteGroup;
-                        });
+                    });
                 }
 
                 // If "LocalRole" info is provided
@@ -487,7 +487,7 @@
                         asyncResp->res
                             .jsonValue[serverType]["RemoteRoleMapping"][index]
                                       ["LocalRole"] = *localRole;
-                        });
+                    });
                 }
             }
             // Create a new RoleMapping Object.
@@ -540,7 +540,7 @@
                     roleMapEntry["LocalRole"] = *localRole;
                     roleMapEntry["RemoteGroup"] = *remoteGroup;
                     remoteRoleJson.emplace_back(std::move(roleMapEntry));
-                    },
+                },
                     ldapDbusService, dbusObjectPath, ldapPrivMapperInterface,
                     "Create", *remoteGroup,
                     getPrivilegeFromRoleId(std::move(*localRole)));
@@ -712,8 +712,8 @@
                 }
             }
             callback(true, confData, ldapType);
-            });
         });
+    });
 }
 
 /**
@@ -829,7 +829,7 @@
                                             serviceAddressList.front());
         }
         BMCWEB_LOG_DEBUG("Updated the service address");
-        });
+    });
 }
 /**
  * @brief updates the LDAP Bind DN and updates the
@@ -977,7 +977,7 @@
             serverTypeJson["LDAPService"]["SearchSettings"];
         searchSettingsJson["UsernameAttribute"] = userNameAttribute;
         BMCWEB_LOG_DEBUG("Updated the user name attr.");
-        });
+    });
 }
 /**
  * @brief updates the LDAP group attribute and updates the
@@ -1011,7 +1011,7 @@
             serverTypeJson["LDAPService"]["SearchSettings"];
         searchSettingsJson["GroupsAttribute"] = groupsAttribute;
         BMCWEB_LOG_DEBUG("Updated the groupname attr");
-        });
+    });
 }
 /**
  * @brief updates the LDAP service enable and updates the
@@ -1041,7 +1041,7 @@
         asyncResp->res.jsonValue[ldapServerElementName]["ServiceEnabled"] =
             serviceEnabled;
         BMCWEB_LOG_DEBUG("Updated Service enable = {}", serviceEnabled);
-        });
+    });
 }
 
 inline void
@@ -1296,7 +1296,7 @@
             handleRoleMapPatch(asyncResp, confData.groupRoleList, serverT,
                                *remoteRoleMapData);
         }
-        });
+    });
 }
 
 inline void updateUserProperties(
@@ -1314,100 +1314,47 @@
         dbusObjectPath, [dbusObjectPath, username, password, roleId, enabled,
                          locked, accountTypes(std::move(accountTypes)),
                          userSelf, asyncResp{std::move(asyncResp)}](int rc) {
-            if (rc <= 0)
+        if (rc <= 0)
+        {
+            messages::resourceNotFound(asyncResp->res, "ManagerAccount",
+                                       username);
+            return;
+        }
+
+        if (password)
+        {
+            int retval = pamUpdatePassword(username, *password);
+
+            if (retval == PAM_USER_UNKNOWN)
             {
                 messages::resourceNotFound(asyncResp->res, "ManagerAccount",
                                            username);
+            }
+            else if (retval == PAM_AUTHTOK_ERR)
+            {
+                // If password is invalid
+                messages::propertyValueFormatError(asyncResp->res, nullptr,
+                                                   "Password");
+                BMCWEB_LOG_ERROR("pamUpdatePassword Failed");
+            }
+            else if (retval != PAM_SUCCESS)
+            {
+                messages::internalError(asyncResp->res);
                 return;
             }
-
-            if (password)
+            else
             {
-                int retval = pamUpdatePassword(username, *password);
-
-                if (retval == PAM_USER_UNKNOWN)
-                {
-                    messages::resourceNotFound(asyncResp->res, "ManagerAccount",
-                                               username);
-                }
-                else if (retval == PAM_AUTHTOK_ERR)
-                {
-                    // If password is invalid
-                    messages::propertyValueFormatError(asyncResp->res, nullptr,
-                                                       "Password");
-                    BMCWEB_LOG_ERROR("pamUpdatePassword Failed");
-                }
-                else if (retval != PAM_SUCCESS)
-                {
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
-                else
-                {
-                    messages::success(asyncResp->res);
-                }
+                messages::success(asyncResp->res);
             }
+        }
 
-            if (enabled)
-            {
-                sdbusplus::asio::setProperty(
-                    *crow::connections::systemBus,
-                    "xyz.openbmc_project.User.Manager", dbusObjectPath,
-                    "xyz.openbmc_project.User.Attributes", "UserEnabled",
-                    *enabled, [asyncResp](const boost::system::error_code& ec) {
-                        if (ec)
-                        {
-                            BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
-                            messages::internalError(asyncResp->res);
-                            return;
-                        }
-                        messages::success(asyncResp->res);
-                    });
-            }
-
-            if (roleId)
-            {
-                std::string priv = getPrivilegeFromRoleId(*roleId);
-                if (priv.empty())
-                {
-                    messages::propertyValueNotInList(asyncResp->res, true,
-                                                     "Locked");
-                    return;
-                }
-
-                sdbusplus::asio::setProperty(
-                    *crow::connections::systemBus,
-                    "xyz.openbmc_project.User.Manager", dbusObjectPath,
-                    "xyz.openbmc_project.User.Attributes", "UserPrivilege",
-                    priv, [asyncResp](const boost::system::error_code& ec) {
-                        if (ec)
-                        {
-                            BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
-                            messages::internalError(asyncResp->res);
-                            return;
-                        }
-                        messages::success(asyncResp->res);
-                    });
-            }
-
-            if (locked)
-            {
-                // admin can unlock the account which is locked by
-                // successive authentication failures but admin should
-                // not be allowed to lock an account.
-                if (*locked)
-                {
-                    messages::propertyValueNotInList(asyncResp->res, "true",
-                                                     "Locked");
-                    return;
-                }
-
-                sdbusplus::asio::setProperty(
-                    *crow::connections::systemBus,
-                    "xyz.openbmc_project.User.Manager", dbusObjectPath,
-                    "xyz.openbmc_project.User.Attributes",
-                    "UserLockedForFailedAttempt", *locked,
-                    [asyncResp](const boost::system::error_code& ec) {
+        if (enabled)
+        {
+            sdbusplus::asio::setProperty(
+                *crow::connections::systemBus,
+                "xyz.openbmc_project.User.Manager", dbusObjectPath,
+                "xyz.openbmc_project.User.Attributes", "UserEnabled", *enabled,
+                [asyncResp](const boost::system::error_code& ec) {
                 if (ec)
                 {
                     BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
@@ -1415,15 +1362,68 @@
                     return;
                 }
                 messages::success(asyncResp->res);
-                    });
+            });
+        }
+
+        if (roleId)
+        {
+            std::string priv = getPrivilegeFromRoleId(*roleId);
+            if (priv.empty())
+            {
+                messages::propertyValueNotInList(asyncResp->res, true,
+                                                 "Locked");
+                return;
             }
 
-            if (accountTypes)
+            sdbusplus::asio::setProperty(
+                *crow::connections::systemBus,
+                "xyz.openbmc_project.User.Manager", dbusObjectPath,
+                "xyz.openbmc_project.User.Attributes", "UserPrivilege", priv,
+                [asyncResp](const boost::system::error_code& ec) {
+                if (ec)
+                {
+                    BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
+                    messages::internalError(asyncResp->res);
+                    return;
+                }
+                messages::success(asyncResp->res);
+            });
+        }
+
+        if (locked)
+        {
+            // admin can unlock the account which is locked by
+            // successive authentication failures but admin should
+            // not be allowed to lock an account.
+            if (*locked)
             {
-                patchAccountTypes(*accountTypes, asyncResp, dbusObjectPath,
-                                  userSelf);
+                messages::propertyValueNotInList(asyncResp->res, "true",
+                                                 "Locked");
+                return;
             }
-        });
+
+            sdbusplus::asio::setProperty(
+                *crow::connections::systemBus,
+                "xyz.openbmc_project.User.Manager", dbusObjectPath,
+                "xyz.openbmc_project.User.Attributes",
+                "UserLockedForFailedAttempt", *locked,
+                [asyncResp](const boost::system::error_code& ec) {
+                if (ec)
+                {
+                    BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
+                    messages::internalError(asyncResp->res);
+                    return;
+                }
+                messages::success(asyncResp->res);
+            });
+        }
+
+        if (accountTypes)
+        {
+            patchAccountTypes(*accountTypes, asyncResp, dbusObjectPath,
+                              userSelf);
+        }
+    });
 }
 
 inline void handleAccountServiceHead(
@@ -1542,7 +1542,7 @@
             asyncResp->res.jsonValue["AccountLockoutThreshold"] =
                 *maxLoginAttemptBeforeLockout;
         }
-        });
+    });
 
     auto callback = [asyncResp](bool success, const LDAPConfigData& confData,
                                 const std::string& ldapType) {
@@ -1597,7 +1597,7 @@
                 return;
             }
             messages::success(asyncResp->res);
-            });
+        });
     }
 
     if (maxPasswordLength)
@@ -1638,13 +1638,13 @@
             "/xyz/openbmc_project/user",
             "xyz.openbmc_project.User.AccountPolicy", "AccountUnlockTimeout",
             *unlockTimeout, [asyncResp](const boost::system::error_code& ec) {
-                if (ec)
-                {
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
-                messages::success(asyncResp->res);
-            });
+            if (ec)
+            {
+                messages::internalError(asyncResp->res);
+                return;
+            }
+            messages::success(asyncResp->res);
+        });
     }
     if (lockoutThreshold)
     {
@@ -1660,7 +1660,7 @@
                 return;
             }
             messages::success(asyncResp->res);
-            });
+        });
     }
 }
 
@@ -1757,7 +1757,7 @@
             }
         }
         asyncResp->res.jsonValue["Members@odata.count"] = memberArray.size();
-        });
+    });
 }
 
 inline void processAfterCreateUser(
@@ -1792,7 +1792,7 @@
             // If password is invalid
             messages::propertyValueFormatError(asyncResp->res, nullptr,
                                                "Password");
-            },
+        },
             "xyz.openbmc_project.User.Manager", userPath,
             "xyz.openbmc_project.Object.Delete", "Delete");
 
@@ -1877,7 +1877,7 @@
         [asyncResp, username, password](const boost::system::error_code& ec2,
                                         sdbusplus::message_t& m) {
         processAfterCreateUser(asyncResp, username, password, ec2, m);
-        },
+    },
         "xyz.openbmc_project.User.Manager", "/xyz/openbmc_project/user",
         "xyz.openbmc_project.User.Manager", "CreateUser", username, userGroups,
         roleId, enabled);
@@ -1938,7 +1938,7 @@
 
         processAfterGetAllGroups(asyncResp, username, password, roleId, enabled,
                                  accountTypes, allGroupsList);
-        });
+    });
 }
 
 inline void
@@ -2015,7 +2015,7 @@
                 const std::pair<sdbusplus::message::object_path,
                                 dbus::utility::DBusInterfacesMap>& user) {
             return accountName == user.first.filename();
-            });
+        });
 
         if (userIt == users.end())
         {
@@ -2132,7 +2132,7 @@
             "/redfish/v1/AccountService/Accounts/{}", accountName);
         asyncResp->res.jsonValue["Id"] = accountName;
         asyncResp->res.jsonValue["UserName"] = accountName;
-        });
+    });
 }
 
 inline void
@@ -2165,7 +2165,7 @@
         }
 
         messages::accountRemoved(asyncResp->res);
-        },
+    },
         "xyz.openbmc_project.User.Manager", userPath,
         "xyz.openbmc_project.Object.Delete", "Delete");
 }
@@ -2258,7 +2258,7 @@
 
         updateUserProperties(asyncResp, newUser, password, enabled, roleId,
                              locked, accountTypes, userSelf);
-        },
+    },
         "xyz.openbmc_project.User.Manager", "/xyz/openbmc_project/user",
         "xyz.openbmc_project.User.Manager", "RenameUser", username,
         *newUserName);
diff --git a/redfish-core/lib/bios.hpp b/redfish-core/lib/bios.hpp
index 8cd05d6..025f436 100644
--- a/redfish-core/lib/bios.hpp
+++ b/redfish-core/lib/bios.hpp
@@ -93,7 +93,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        },
+    },
         "org.open_power.Software.Host.Updater", "/xyz/openbmc_project/software",
         "xyz.openbmc_project.Common.FactoryReset", "Reset");
 }
diff --git a/redfish-core/lib/cable.hpp b/redfish-core/lib/cable.hpp
index a39d00a..a2d0b53 100644
--- a/redfish-core/lib/cable.hpp
+++ b/redfish-core/lib/cable.hpp
@@ -98,7 +98,7 @@
                         const boost::system::error_code& ec,
                         const dbus::utility::DBusPropertiesMap& properties) {
                     fillCableProperties(asyncResp->res, ec, properties);
-                    });
+                });
             }
             else if (interface == "xyz.openbmc_project.Inventory.Item")
             {
@@ -123,7 +123,7 @@
                     {
                         asyncResp->res.jsonValue["Status"]["State"] = "Absent";
                     }
-                    });
+                });
             }
         }
     }
@@ -184,8 +184,8 @@
                 return;
             }
             messages::resourceNotFound(asyncResp->res, "Cable", cableId);
-            });
         });
+    });
 }
 
 /**
@@ -212,7 +212,7 @@
         collection_util::getCollectionMembers(
             asyncResp, boost::urls::url("/redfish/v1/Cables"), interfaces,
             "/xyz/openbmc_project/inventory");
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index 10931c4..00e509d 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -274,7 +274,7 @@
         }
 
         asyncResp->res.jsonValue[countPtr] = links.size();
-        });
+    });
 }
 
 /**
@@ -373,7 +373,7 @@
         asyncResp->res.addHeader(
             boost::beast::http::field::location,
             std::string_view(certURL.data(), certURL.size()));
-        });
+    });
 }
 
 static void
@@ -391,7 +391,7 @@
         }
         BMCWEB_LOG_INFO("Certificate deleted");
         asyncResp->res.result(boost::beast::http::status::no_content);
-        },
+    },
         service, objectPath, certs::objDeleteIntf, "Delete");
 }
 
@@ -572,7 +572,7 @@
         getCertificateProperties(asyncResp, objectPath, service, id, url, name);
         BMCWEB_LOG_DEBUG("HTTPS certificate install file={}",
                          certFile->getCertFilePath());
-        },
+    },
         service, objectPath, certs::certReplaceIntf, "Replace",
         certFile->getCertFilePath());
 }
@@ -614,7 +614,7 @@
         asyncResp->res.jsonValue["CSRString"] = csr;
         asyncResp->res.jsonValue["CertificateCollection"]["@odata.id"] =
             certURI;
-        },
+    },
         service, csrObjPath, "xyz.openbmc_project.Certs.CSR", "CSR");
 }
 
@@ -833,7 +833,7 @@
                 break;
             }
         }
-        });
+    });
     crow::connections::systemBus->async_method_call(
         [asyncResp](const boost::system::error_code& ec, const std::string&) {
         if (ec)
@@ -842,7 +842,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        },
+    },
         service, objectPath, "xyz.openbmc_project.Certs.CSR.Create",
         "GenerateCSR", *optAlternativeNames, *optChallengePassword, city,
         commonName, *optContactPerson, country, *optEmail, *optGivenName,
@@ -944,7 +944,7 @@
                                  certId, certURL, "HTTPS Certificate");
         BMCWEB_LOG_DEBUG("HTTPS certificate install file={}",
                          certFile->getCertFilePath());
-        },
+    },
         certs::httpsServiceName, certs::httpsObjectPath, certs::certInstallIntf,
         "Install", certFile->getCertFilePath());
 }
@@ -1049,7 +1049,7 @@
                                  certId, certURL, "LDAP Certificate");
         BMCWEB_LOG_DEBUG("LDAP certificate install file={}",
                          certFile->getCertFilePath());
-        },
+    },
         certs::ldapServiceName, certs::ldapObjectPath, certs::certInstallIntf,
         "Install", certFile->getCertFilePath());
 }
@@ -1171,7 +1171,7 @@
                                  "TrustStore Certificate");
         BMCWEB_LOG_DEBUG("TrustStore certificate install file={}",
                          certFile->getCertFilePath());
-        },
+    },
         certs::authorityServiceName, certs::authorityObjectPath,
         certs::certInstallIntf, "Install", certFile->getCertFilePath());
 }
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index 0d14d4e..469c903 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -85,7 +85,7 @@
         asyncResp->res.jsonValue["Links"]["Storage@odata.count"] =
             storages.size();
         asyncResp->res.jsonValue["Links"]["Storage"] = std::move(storages);
-        });
+    });
 }
 
 /**
@@ -131,7 +131,7 @@
             asyncResp->res.jsonValue["PowerState"] = "Off";
             asyncResp->res.jsonValue["Status"]["State"] = "StandbyOffline";
         }
-        });
+    });
 }
 
 inline void getIntrusionByService(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
@@ -156,7 +156,7 @@
         asyncResp->res.jsonValue["PhysicalSecurity"]["IntrusionSensorNumber"] =
             1;
         asyncResp->res.jsonValue["PhysicalSecurity"]["IntrusionSensor"] = value;
-        });
+    });
 }
 
 /**
@@ -189,7 +189,7 @@
                 return;
             }
         }
-        });
+    });
 }
 
 inline void handleChassisCollectionGet(
@@ -341,7 +341,7 @@
 
         asyncResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
             property;
-        });
+    });
 }
 
 inline void getChassisUUID(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -360,7 +360,7 @@
             return;
         }
         asyncResp->res.jsonValue["UUID"] = chassisUUID;
-        });
+    });
 }
 
 inline void
@@ -418,7 +418,7 @@
                         return; // no sensors = no failures
                     }
                     health->inventory = resp;
-                    });
+                });
 
                 health->populate();
             }
@@ -459,7 +459,7 @@
                 reference["@odata.id"] = boost::urls::format(
                     "/redfish/v1/Chassis/{}/Drives", chassisId);
                 asyncResp->res.jsonValue["Drives"] = std::move(reference);
-                });
+            });
 
             const std::string& connectionName = connectionNames[0].first;
 
@@ -491,7 +491,7 @@
                             return;
                         }
                         asyncResp->res.jsonValue["AssetTag"] = property;
-                        });
+                    });
                 }
                 else if (interface == replaceableInterface)
                 {
@@ -510,7 +510,7 @@
                             return;
                         }
                         asyncResp->res.jsonValue["HotPluggable"] = property;
-                        });
+                    });
                 }
             }
 
@@ -620,7 +620,7 @@
                     std::move(managedBy);
                 getChassisState(asyncResp);
                 getStorageLink(asyncResp, path);
-                });
+            });
 
             for (const auto& interface : interfaces2)
             {
@@ -640,7 +640,7 @@
 
         // Couldn't find an object with that name.  return an error
         messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
-        });
+    });
 
     getPhysicalSecurityData(asyncResp);
 }
@@ -765,7 +765,7 @@
         }
 
         messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
-        });
+    });
 }
 
 /**
@@ -864,8 +864,8 @@
             }
 
             messages::success(asyncResp->res);
-            });
         });
+    });
 }
 
 inline void handleChassisResetActionInfoPost(
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index bd44677..80da49b 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -637,7 +637,7 @@
         {
             messages::internalError(asyncResp->res);
         }
-        },
+    },
         "xyz.openbmc_project.Network",
         "/xyz/openbmc_project/network/" + ifaceId + ipHash,
         "xyz.openbmc_project.Object.Delete", "Delete");
@@ -652,13 +652,13 @@
         "/xyz/openbmc_project/network/" + ifaceId,
         "xyz.openbmc_project.Network.EthernetInterface", "DefaultGateway",
         gateway, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            asyncResp->res.result(boost::beast::http::status::no_content);
-        });
+        if (ec)
+        {
+            messages::internalError(asyncResp->res);
+            return;
+        }
+        asyncResp->res.result(boost::beast::http::status::no_content);
+    });
 }
 /**
  * @brief Creates a static IPv4 entry
@@ -675,8 +675,8 @@
                        const std::string& gateway, const std::string& address,
                        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
 {
-    auto createIpHandler =
-        [asyncResp, ifaceId, gateway](const boost::system::error_code& ec) {
+    auto createIpHandler = [asyncResp, ifaceId,
+                            gateway](const boost::system::error_code& ec) {
         if (ec)
         {
             messages::internalError(asyncResp->res);
@@ -733,12 +733,12 @@
             {
                 messages::internalError(asyncResp->res);
             }
-            },
+        },
             "xyz.openbmc_project.Network",
             "/xyz/openbmc_project/network/" + ifaceId,
             "xyz.openbmc_project.Network.IP.Create", "IP", protocol, address,
             prefixLength, gateway);
-        },
+    },
         "xyz.openbmc_project.Network",
         "/xyz/openbmc_project/network/" + ifaceId + id,
         "xyz.openbmc_project.Object.Delete", "Delete");
@@ -758,8 +758,8 @@
                        const std::string& address,
                        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
 {
-    auto createIpHandler =
-        [asyncResp, address](const boost::system::error_code& ec) {
+    auto createIpHandler = [asyncResp,
+                            address](const boost::system::error_code& ec) {
         if (ec)
         {
             if (ec == boost::system::errc::io_error)
@@ -834,7 +834,7 @@
         extractIPV6Data(ethifaceId, resp, ipv6Data);
         // Finally make a callback with useful data
         callback(true, ethData, ipv4Data, ipv6Data);
-        });
+    });
 }
 
 /**
@@ -889,7 +889,7 @@
 
         // Finally make a callback with useful data
         callback(true, ifaceList);
-        });
+    });
 }
 
 inline void
@@ -912,7 +912,7 @@
         {
             messages::internalError(asyncResp->res);
         }
-        });
+    });
 }
 
 inline void
@@ -929,7 +929,7 @@
         {
             messages::internalError(asyncResp->res);
         }
-        });
+    });
 }
 
 inline void
@@ -943,11 +943,11 @@
         "/xyz/openbmc_project/network/" + ifaceId,
         "xyz.openbmc_project.Network.EthernetInterface", "DomainName",
         vectorDomainname, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                messages::internalError(asyncResp->res);
-            }
-        });
+        if (ec)
+        {
+            messages::internalError(asyncResp->res);
+        }
+    });
 }
 
 inline bool isHostnameValid(const std::string& hostname)
@@ -1039,7 +1039,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        });
+    });
 }
 
 inline void setDHCPEnabled(const std::string& ifaceId,
@@ -1060,7 +1060,7 @@
             return;
         }
         messages::success(asyncResp->res);
-        });
+    });
 }
 
 inline void setEthernetInterfaceBoolProperty(
@@ -1078,7 +1078,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        });
+    });
 }
 
 inline void setDHCPv4Config(const std::string& propertyName, const bool& value,
@@ -1096,7 +1096,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        });
+    });
 }
 
 inline void handleSLAACAutoConfigPatch(
@@ -1117,7 +1117,7 @@
             return;
         }
         messages::success(asyncResp->res);
-        });
+    });
 }
 
 inline void handleDHCPPatch(const std::string& ifaceId,
@@ -1425,7 +1425,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        });
+    });
 }
 
 inline void handleIPv6StaticAddressesPatch(
@@ -1576,7 +1576,7 @@
             }
 
             health->inventory = resp;
-            });
+        });
 
         health->populate();
     }
@@ -1830,7 +1830,7 @@
             asyncResp->res.jsonValue["@odata.id"] =
                 "/redfish/v1/Managers/bmc/EthernetInterfaces";
         });
-        });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/EthernetInterfaces/")
         .privileges(redfish::privileges::postEthernetInterfaceCollection)
@@ -1910,11 +1910,11 @@
                             const sdbusplus::message_t& m) {
             afterVlanCreate(asyncResp, parentInterfaceUri, vlanInterface, ec,
                             m);
-            },
+        },
             "xyz.openbmc_project.Network", "/xyz/openbmc_project/network",
             "xyz.openbmc_project.Network.VLAN.Create", "VLAN", parentInterface,
             vlanId);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/EthernetInterfaces/<str>/")
         .privileges(redfish::privileges::getEthernetInterface)
@@ -1948,8 +1948,8 @@
                 "Management Network Interface";
 
             parseInterfaceData(asyncResp, ifaceId, ethData, ipv4Data, ipv6Data);
-            });
         });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/EthernetInterfaces/<str>/")
         .privileges(redfish::privileges::patchEthernetInterface)
diff --git a/redfish-core/lib/event_service.hpp b/redfish-core/lib/event_service.hpp
index c1ad0d8..ee8fc5d 100644
--- a/redfish-core/lib/event_service.hpp
+++ b/redfish-core/lib/event_service.hpp
@@ -98,7 +98,7 @@
 
         asyncResp->res.jsonValue["SSEFilterPropertiesSupported"] =
             std::move(supportedSSEFilters);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/EventService/")
         .privileges(redfish::privileges::patchEventService)
@@ -162,7 +162,7 @@
 
         EventServiceManager::getInstance().setEventServiceConfig(
             eventServiceConfig);
-        });
+    });
 }
 
 inline void requestRoutesSubmitTestEvent(App& app)
@@ -184,7 +184,7 @@
             return;
         }
         asyncResp->res.result(boost::beast::http::status::no_content);
-        });
+    });
 }
 
 inline void doSubscriptionCollection(
@@ -255,11 +255,11 @@
             [asyncResp](const boost::system::error_code& ec,
                         const dbus::utility::ManagedObjectType& resp) {
             doSubscriptionCollection(ec, asyncResp, resp);
-            },
+        },
             "xyz.openbmc_project.Network.SNMP",
             "/xyz/openbmc_project/network/snmp/manager",
             "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
-        });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/EventService/Subscriptions/")
         .privileges(redfish::privileges::postEventDestinationCollection)
@@ -559,7 +559,7 @@
                             [&id](const redfish::registries::MessageEntry&
                                       messageEntry) {
                         return id == messageEntry.first;
-                            }))
+                    }))
                     {
                         validId = true;
                         break;
@@ -621,7 +621,7 @@
         messages::created(asyncResp->res);
         asyncResp->res.addHeader(
             "Location", "/redfish/v1/EventService/Subscriptions/" + id);
-        });
+    });
 }
 
 inline void requestRoutesEventDestination(App& app)
@@ -680,7 +680,7 @@
             mrdJsonArray.emplace_back(std::move(mdr));
         }
         asyncResp->res.jsonValue["MetricReportDefinitions"] = mrdJsonArray;
-        });
+    });
     BMCWEB_ROUTE(app, "/redfish/v1/EventService/Subscriptions/<str>/")
         // The below privilege is wrong, it should be ConfigureManager OR
         // ConfigureSelf
@@ -754,7 +754,7 @@
         }
 
         EventServiceManager::getInstance().updateSubscriptionData();
-        });
+    });
     BMCWEB_ROUTE(app, "/redfish/v1/EventService/Subscriptions/<str>/")
         // The below privilege is wrong, it should be ConfigureManager OR
         // ConfigureSelf
@@ -783,7 +783,7 @@
             return;
         }
         EventServiceManager::getInstance().deleteSubscription(param);
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/fabric_adapters.hpp b/redfish-core/lib/fabric_adapters.hpp
index 317348f..a8373a1 100644
--- a/redfish-core/lib/fabric_adapters.hpp
+++ b/redfish-core/lib/fabric_adapters.hpp
@@ -58,7 +58,7 @@
 
         asyncResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
             property;
-        });
+    });
 }
 
 inline void
@@ -117,7 +117,7 @@
         {
             asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
         }
-        });
+    });
 }
 
 inline void
@@ -143,7 +143,7 @@
         {
             asyncResp->res.jsonValue["Status"]["State"] = "Absent";
         }
-        });
+    });
 }
 
 inline void
@@ -170,7 +170,7 @@
         {
             asyncResp->res.jsonValue["Status"]["Health"] = "Critical";
         }
-        });
+    });
 }
 
 inline void doAdapterGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -242,7 +242,7 @@
         }
         BMCWEB_LOG_WARNING("Adapter not found");
         messages::resourceNotFound(asyncResp->res, "FabricAdapter", adapterId);
-        });
+    });
 }
 
 inline void
@@ -269,7 +269,7 @@
                                            const std::string& serviceName) {
         doAdapterGet(asyncResp, systemName, adapterId, fabricAdapterPath,
                      serviceName);
-        });
+    });
 }
 
 inline void handleFabricAdapterCollectionGet(
diff --git a/redfish-core/lib/fan.hpp b/redfish-core/lib/fan.hpp
index 7e4f8fa..8915229 100644
--- a/redfish-core/lib/fan.hpp
+++ b/redfish-core/lib/fan.hpp
@@ -76,7 +76,7 @@
             return;
         }
         callback(subtreePaths);
-        });
+    });
 }
 
 inline void doFanCollection(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -127,7 +127,7 @@
         asyncResp->res.addHeader(
             boost::beast::http::field::link,
             "</redfish/v1/JsonSchemas/FanCollection/FanCollection.json>; rel=describedby");
-        });
+    });
 }
 
 inline void
@@ -191,7 +191,7 @@
                 return;
             }
             callback(fanPath, object.begin()->first);
-            });
+        });
 
         return;
     }
@@ -210,7 +210,7 @@
         [fanId, asyncResp, callback](
             const dbus::utility::MapperGetSubTreePathsResponse& fanPaths) {
         handleFanPath(fanId, asyncResp, fanPaths, callback);
-        });
+    });
 }
 
 inline void addFanCommonProperties(crow::Response& resp,
@@ -250,7 +250,7 @@
         {
             asyncResp->res.jsonValue["Status"]["Health"] = "Critical";
         }
-        });
+    });
 }
 
 inline void getFanState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -275,7 +275,7 @@
         {
             asyncResp->res.jsonValue["Status"]["State"] = "Absent";
         }
-        });
+    });
 }
 
 inline void getFanAsset(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -332,7 +332,7 @@
         {
             asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
         }
-        });
+    });
 }
 
 inline void getFanLocation(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -356,7 +356,7 @@
         }
         asyncResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
             property;
-        });
+    });
 }
 
 inline void
@@ -411,7 +411,7 @@
                 boost::beast::http::field::link,
                 "</redfish/v1/JsonSchemas/Fan/Fan.json>; rel=describedby");
         });
-        });
+    });
 }
 
 inline void handleFanGet(App& app, const crow::Request& req,
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp
index 0c35cb5..6e0d334 100644
--- a/redfish-core/lib/health.hpp
+++ b/redfish-core/lib/health.hpp
@@ -206,7 +206,7 @@
                 return;
             }
             self->globalInventoryPath = resp[0];
-            });
+        });
     }
 
     void getAllStatusAssociations()
@@ -232,7 +232,7 @@
                 }
                 it = self->statuses.erase(it);
             }
-            });
+        });
     }
 
     std::shared_ptr<bmcweb::AsyncResp> asyncResp;
diff --git a/redfish-core/lib/hypervisor_system.hpp b/redfish-core/lib/hypervisor_system.hpp
index 0a8936d..0df84b8 100644
--- a/redfish-core/lib/hypervisor_system.hpp
+++ b/redfish-core/lib/hypervisor_system.hpp
@@ -90,7 +90,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        });
+    });
 }
 
 /**
@@ -145,7 +145,7 @@
             "/redfish/v1/Systems/hypervisor/Actions/ComputerSystem.Reset";
         reset["@Redfish.ActionInfo"] =
             "/redfish/v1/Systems/hypervisor/ResetActionInfo";
-        });
+    });
 }
 
 inline bool extractHypervisorInterfaceData(
@@ -333,7 +333,7 @@
             BMCWEB_LOG_INFO("Hypervisor Interface not found");
         }
         callback(found, ethData, ipv4Data);
-        });
+    });
 }
 
 /**
@@ -362,7 +362,7 @@
             return;
         }
         BMCWEB_LOG_DEBUG("Hypervisor IPaddress is Set");
-        });
+    });
 }
 
 /**
@@ -392,7 +392,7 @@
             return;
         }
         BMCWEB_LOG_DEBUG("SubnetMask is Set");
-        });
+    });
 }
 
 /**
@@ -416,13 +416,13 @@
         "/xyz/openbmc_project/network/hypervisor",
         "xyz.openbmc_project.Network.SystemConfiguration", "DefaultGateway",
         gateway, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                BMCWEB_LOG_ERROR("DBUS response error {}", ec);
-                return;
-            }
-            BMCWEB_LOG_DEBUG("Default Gateway is Set");
-        });
+        if (ec)
+        {
+            BMCWEB_LOG_ERROR("DBUS response error {}", ec);
+            return;
+        }
+        BMCWEB_LOG_DEBUG("Default Gateway is Set");
+    });
 }
 
 /**
@@ -519,7 +519,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        });
+    });
 
     // Set the IPv4 address origin to the DHCP / Static as per the new value
     // of the DHCPEnabled property
@@ -547,7 +547,7 @@
             return;
         }
         BMCWEB_LOG_DEBUG("Hypervisor IPaddress Origin is Set");
-        });
+    });
 }
 
 inline void handleHypervisorIPv4StaticPatch(
@@ -674,7 +674,7 @@
         {
             messages::internalError(asyncResp->res);
         }
-        });
+    });
 }
 
 inline void
@@ -690,7 +690,7 @@
         {
             messages::internalError(asyncResp->res);
         }
-        });
+    });
 }
 
 inline void handleHypervisorEthernetInterfaceCollectionGet(
@@ -741,7 +741,7 @@
             ifaceArray.emplace_back(std::move(ethIface));
         }
         asyncResp->res.jsonValue["Members@odata.count"] = ifaceArray.size();
-        });
+    });
 }
 
 inline void handleHypervisorEthernetInterfaceGet(
@@ -756,20 +756,20 @@
         id, [asyncResp, ifaceId{std::string(id)}](
                 bool success, const EthernetInterfaceData& ethData,
                 const std::vector<IPv4AddressData>& ipv4Data) {
-            if (!success)
-            {
-                messages::resourceNotFound(asyncResp->res, "EthernetInterface",
-                                           ifaceId);
-                return;
-            }
-            asyncResp->res.jsonValue["@odata.type"] =
-                "#EthernetInterface.v1_9_0.EthernetInterface";
-            asyncResp->res.jsonValue["Name"] = "Hypervisor Ethernet Interface";
-            asyncResp->res.jsonValue["Description"] =
-                "Hypervisor's Virtual Management Ethernet Interface";
-            parseInterfaceData(asyncResp->res.jsonValue, ifaceId, ethData,
-                               ipv4Data);
-        });
+        if (!success)
+        {
+            messages::resourceNotFound(asyncResp->res, "EthernetInterface",
+                                       ifaceId);
+            return;
+        }
+        asyncResp->res.jsonValue["@odata.type"] =
+            "#EthernetInterface.v1_9_0.EthernetInterface";
+        asyncResp->res.jsonValue["Name"] = "Hypervisor Ethernet Interface";
+        asyncResp->res.jsonValue["Description"] =
+            "Hypervisor's Virtual Management Ethernet Interface";
+        parseInterfaceData(asyncResp->res.jsonValue, ifaceId, ethData,
+                           ipv4Data);
+    });
 }
 
 inline void handleHypervisorSystemGet(
@@ -806,7 +806,7 @@
         getHypervisorState(asyncResp);
         getHypervisorActions(asyncResp);
         // TODO: Add "SystemType" : "hypervisor"
-        });
+    });
 }
 
 inline void handleHypervisorEthernetInterfacePatch(
@@ -848,12 +848,11 @@
     }
 
     getHypervisorIfaceData(
-        ifaceId,
-        [asyncResp, ifaceId, hostName = std::move(hostName),
-         ipv4StaticAddresses = std::move(ipv4StaticAddresses), ipv4DHCPEnabled,
-         dhcpv4 = std::move(dhcpv4)](bool success,
-                                     const EthernetInterfaceData& ethData,
-                                     const std::vector<IPv4AddressData>&) {
+        ifaceId, [asyncResp, ifaceId, hostName = std::move(hostName),
+                  ipv4StaticAddresses = std::move(ipv4StaticAddresses),
+                  ipv4DHCPEnabled, dhcpv4 = std::move(dhcpv4)](
+                     bool success, const EthernetInterfaceData& ethData,
+                     const std::vector<IPv4AddressData>&) {
         if (!success)
         {
             messages::resourceNotFound(asyncResp->res, "EthernetInterface",
@@ -911,7 +910,7 @@
         // to enabled/active by the pldm once the hypervisor
         // consumes the updated settings from the user.
         setIPv4InterfaceEnabled(ifaceId, false, asyncResp);
-        });
+    });
     asyncResp->res.result(boost::beast::http::status::accepted);
 }
 
@@ -970,7 +969,7 @@
         parameter["AllowableValues"] = std::move(allowed);
         parameters.emplace_back(std::move(parameter));
         asyncResp->res.jsonValue["Parameters"] = std::move(parameters);
-        });
+    });
 }
 
 inline void handleHypervisorSystemResetPost(
@@ -1030,7 +1029,7 @@
             return;
         }
         messages::success(asyncResp->res);
-        });
+    });
 }
 
 inline void requestRoutesHypervisorSystems(App& app)
diff --git a/redfish-core/lib/led.hpp b/redfish-core/lib/led.hpp
index f36a319..ff77ddc 100644
--- a/redfish-core/lib/led.hpp
+++ b/redfish-core/lib/led.hpp
@@ -86,8 +86,8 @@
             {
                 asyncResp->res.jsonValue["IndicatorLED"] = "Off";
             }
-            });
         });
+    });
 }
 
 /**
@@ -151,8 +151,8 @@
                 return;
             }
             messages::success(asyncResp->res);
-            });
         });
+    });
 }
 
 /**
@@ -209,8 +209,8 @@
             }
 
             asyncResp->res.jsonValue["LocationIndicatorActive"] = ledOn;
-            });
         });
+    });
 }
 
 /**
@@ -248,8 +248,8 @@
                     messages::internalError(asyncResp->res);
                     return;
                 }
-                });
+            });
         }
-        });
+    });
 }
 } // namespace redfish
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 2899b01..116bc8a 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -569,7 +569,7 @@
         }
         asyncResp->res.jsonValue["Members@odata.count"] = entriesArray.size();
         asyncResp->res.jsonValue["Members"] = std::move(entriesArray);
-        });
+    });
 }
 
 inline void
@@ -669,15 +669,15 @@
                                        entryID);
             return;
         }
-        });
+    });
 }
 
 inline void deleteDumpEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                             const std::string& entryID,
                             const std::string& dumpType)
 {
-    auto respHandler =
-        [asyncResp, entryID](const boost::system::error_code& ec) {
+    auto respHandler = [asyncResp,
+                        entryID](const boost::system::error_code& ec) {
         BMCWEB_LOG_DEBUG("Dump Entry doDelete callback: Done");
         if (ec)
         {
@@ -1022,7 +1022,7 @@
                              createdObjPath.str);
             taskData->state = "Completed";
             return task::completed;
-            },
+        },
             "type='signal',interface='org.freedesktop.DBus.Properties',"
             "member='PropertiesChanged',path='" +
                 createdObjPath.str + "'");
@@ -1032,7 +1032,7 @@
         task->startTimer(std::chrono::minutes(6));
         task->populateResp(asyncResp->res);
         task->payload.emplace(payload);
-        },
+    },
         "xyz.openbmc_project.Dump.Manager", createdObjPath,
         "org.freedesktop.DBus.Introspectable", "Introspect");
 }
@@ -1166,7 +1166,7 @@
         }
         BMCWEB_LOG_DEBUG("Dump Created. Path: {}", objPath.str);
         createDumpTaskCallback(std::move(payload), asyncResp, objPath);
-        },
+    },
         "xyz.openbmc_project.Dump.Manager",
         "/xyz/openbmc_project/dump/" +
             std::string(boost::algorithm::to_lower_copy(dumpType)),
@@ -1187,7 +1187,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        },
+    },
         "xyz.openbmc_project.Dump.Manager",
         "/xyz/openbmc_project/dump/" + dumpTypeLowerCopy,
         "xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
@@ -1323,8 +1323,8 @@
                     return;
                 }
             }
-            });
         });
+    });
 }
 
 inline void requestRoutesEventLogService(App& app)
@@ -1367,7 +1367,7 @@
 
             {"target",
              "/redfish/v1/Systems/system/LogServices/EventLog/Actions/LogService.ClearLog"}};
-        });
+    });
 }
 
 inline void requestRoutesJournalEventLogClear(App& app)
@@ -1412,11 +1412,11 @@
             }
 
             messages::success(asyncResp->res);
-            },
+        },
             "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
             "org.freedesktop.systemd1.Manager", "ReloadUnit", "rsyslog.service",
             "replace");
-        });
+    });
 }
 
 enum class LogParseError
@@ -1611,7 +1611,7 @@
                 "/redfish/v1/Systems/system/LogServices/EventLog/Entries?$skip=" +
                 std::to_string(skip + top);
         }
-        });
+    });
 }
 
 inline void requestRoutesJournalEventLogEntry(App& app)
@@ -1689,7 +1689,7 @@
         }
         // Requested ID was not found
         messages::resourceNotFound(asyncResp->res, "LogEntry", targetID);
-        });
+    });
 }
 
 inline void requestRoutesDBusEventLogEntryCollection(App& app)
@@ -1884,8 +1884,8 @@
             asyncResp->res.jsonValue["Members@odata.count"] =
                 entriesArray.size();
             asyncResp->res.jsonValue["Members"] = std::move(entriesArray);
-            });
         });
+    });
 }
 
 inline void requestRoutesDBusEventLogEntry(App& app)
@@ -2001,8 +2001,8 @@
                     "/redfish/v1/Systems/system/LogServices/EventLog/Entries/" +
                     std::to_string(*id) + "/attachment";
             }
-            });
         });
+    });
 
     BMCWEB_ROUTE(
         app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
@@ -2048,8 +2048,8 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            });
         });
+    });
 
     BMCWEB_ROUTE(
         app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
@@ -2083,8 +2083,8 @@
         dbus::utility::escapePathForDbus(entryID);
 
         // Process response from Logging service.
-        auto respHandler =
-            [asyncResp, entryID](const boost::system::error_code& ec) {
+        auto respHandler = [asyncResp,
+                            entryID](const boost::system::error_code& ec) {
             BMCWEB_LOG_DEBUG("EventLogEntry (DBus) doDelete callback: Done");
             if (ec)
             {
@@ -2111,7 +2111,7 @@
             respHandler, "xyz.openbmc_project.Logging",
             "/xyz/openbmc_project/logging/entry/" + entryID,
             "xyz.openbmc_project.Object.Delete", "Delete");
-        });
+    });
 }
 
 constexpr const char* hostLoggerFolderPath = "/var/log/console";
@@ -2225,7 +2225,7 @@
         asyncResp->res.jsonValue["Id"] = "HostLogger";
         asyncResp->res.jsonValue["Entries"]["@odata.id"] =
             "/redfish/v1/Systems/system/LogServices/HostLogger/Entries";
-        });
+    });
 }
 
 inline void requestRoutesSystemHostLoggerCollection(App& app)
@@ -2315,7 +2315,7 @@
                     std::to_string(skip + top);
             }
         }
-        });
+    });
 }
 
 inline void requestRoutesSystemHostLoggerLogEntry(App& app)
@@ -2387,7 +2387,7 @@
 
         // Requested ID was not found
         messages::resourceNotFound(asyncResp->res, "LogEntry", param);
-        });
+    });
 }
 
 inline void handleBMCLogServicesCollectionGet(
@@ -2459,7 +2459,7 @@
 
         asyncResp->res.jsonValue["Members@odata.count"] =
             logServiceArrayLocal.size();
-        });
+    });
 #endif
 }
 
@@ -2499,7 +2499,7 @@
 
         asyncResp->res.jsonValue["Entries"]["@odata.id"] =
             "/redfish/v1/Managers/bmc/LogServices/Journal/Entries";
-        });
+    });
 }
 
 static int
@@ -2646,7 +2646,7 @@
                 "/redfish/v1/Managers/bmc/LogServices/Journal/Entries?$skip=" +
                 std::to_string(skip + top);
         }
-        });
+    });
 }
 
 inline void requestRoutesBMCJournalLogEntry(App& app)
@@ -2718,7 +2718,7 @@
             return;
         }
         asyncResp->res.jsonValue.update(bmcJournalLogEntry);
-        });
+    });
 }
 
 inline void
@@ -2805,7 +2805,7 @@
                 break;
             }
         }
-        });
+    });
 }
 
 inline void handleLogServicesDumpServiceGet(
@@ -3251,7 +3251,7 @@
         asyncResp->res.jsonValue["Actions"]["#LogService.CollectDiagnosticData"]
                                 ["target"] =
             "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/LogService.CollectDiagnosticData";
-        });
+    });
 }
 
 void inline requestRoutesCrashdumpClear(App& app)
@@ -3292,9 +3292,9 @@
                 return;
             }
             messages::success(asyncResp->res);
-            },
+        },
             crashdumpObject, crashdumpPath, deleteAllInterface, "DeleteAll");
-        });
+    });
 }
 
 static void
@@ -3441,8 +3441,8 @@
                 logCrashdumpEntry(asyncResp, logID,
                                   asyncResp->res.jsonValue["Members"]);
             }
-            });
         });
+    });
 }
 
 inline void requestRoutesCrashdumpEntry(App& app)
@@ -3478,7 +3478,7 @@
         }
         const std::string& logID = param;
         logCrashdumpEntry(asyncResp, logID, asyncResp->res.jsonValue);
-        });
+    });
 }
 
 inline void requestRoutesCrashdumpFile(App& app)
@@ -3563,7 +3563,7 @@
             *crow::connections::systemBus, crashdumpObject,
             crashdumpPath + std::string("/") + logID, crashdumpInterface,
             std::move(getStoredLogCallback));
-        });
+    });
 }
 
 enum class OEMDiagnosticType
@@ -3705,7 +3705,7 @@
                     taskData->state = "Completed";
                 }
                 return task::completed;
-                },
+            },
                 taskMatchStr);
 
             task->startTimer(std::chrono::minutes(5));
@@ -3716,7 +3716,7 @@
         crow::connections::systemBus->async_method_call(
             std::move(collectCrashdumpCallback), crashdumpObject, crashdumpPath,
             iface, method);
-        });
+    });
 }
 
 /**
@@ -3777,7 +3777,7 @@
             respHandler, "xyz.openbmc_project.Logging",
             "/xyz/openbmc_project/logging",
             "xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
-        });
+    });
 }
 
 /****************************************************
@@ -3829,7 +3829,7 @@
         asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"] = {
             {"target",
              "/redfish/v1/Systems/system/LogServices/PostCodes/Actions/LogService.ClearLog"}};
-        });
+    });
 }
 
 inline void requestRoutesPostCodesClear(App& app)
@@ -3877,11 +3877,11 @@
                 return;
             }
             messages::success(asyncResp->res);
-            },
+        },
             "xyz.openbmc_project.State.Boot.PostCode0",
             "/xyz/openbmc_project/State/Boot/PostCode0",
             "xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
-        });
+    });
 }
 
 /**
@@ -4094,7 +4094,7 @@
             messages::resourceNotFound(asyncResp->res, "LogEntry", entryId);
             return;
         }
-        },
+    },
         "xyz.openbmc_project.State.Boot.PostCode0",
         "/xyz/openbmc_project/State/Boot/PostCode0",
         "xyz.openbmc_project.State.Boot.PostCode", "GetPostCodesWithTimeStamp",
@@ -4150,7 +4150,7 @@
                 "/redfish/v1/Systems/system/LogServices/PostCodes/Entries?$skip=" +
                 std::to_string(skip + top);
         }
-        },
+    },
         "xyz.openbmc_project.State.Boot.PostCode0",
         "/xyz/openbmc_project/State/Boot/PostCode0",
         "xyz.openbmc_project.State.Boot.PostCode", "GetPostCodesWithTimeStamp",
@@ -4176,7 +4176,7 @@
             return;
         }
         getPostCodeForBoot(asyncResp, 1, bootCount, entryCount, skip, top);
-        });
+    });
 }
 
 inline void requestRoutesPostCodesEntryCollection(App& app)
@@ -4224,7 +4224,7 @@
         size_t skip = delegatedQuery.skip.value_or(0);
         size_t top = delegatedQuery.top.value_or(query_param::Query::maxTop);
         getCurrentBootNumber(asyncResp, skip, top);
-        });
+    });
 }
 
 inline void requestRoutesPostCodesEntryAdditionalData(App& app)
@@ -4315,11 +4315,11 @@
             asyncResp->res.addHeader(
                 boost::beast::http::field::content_transfer_encoding, "Base64");
             asyncResp->res.body() = crow::utility::base64encode(strData);
-            },
+        },
             "xyz.openbmc_project.State.Boot.PostCode0",
             "/xyz/openbmc_project/State/Boot/PostCode0",
             "xyz.openbmc_project.State.Boot.PostCode", "GetPostCodes", index);
-        });
+    });
 }
 
 inline void requestRoutesPostCodesEntry(App& app)
@@ -4350,7 +4350,7 @@
         }
 
         getPostCodeForEntry(asyncResp, targetID);
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index 32385de..314099b 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -75,7 +75,7 @@
         }
 
         messages::success(asyncResp->res);
-        });
+    });
 }
 
 inline void
@@ -102,7 +102,7 @@
         }
 
         messages::success(asyncResp->res);
-        });
+    });
 }
 
 /**
@@ -153,7 +153,7 @@
                                               "ResetType");
 
         return;
-        });
+    });
 }
 
 /**
@@ -219,11 +219,11 @@
             // Factory Reset doesn't actually happen until a reboot
             // Can't erase what the BMC is running on
             doBMCGracefulRestart(asyncResp);
-            },
+        },
             "xyz.openbmc_project.Software.BMC.Updater",
             "/xyz/openbmc_project/software",
             "xyz.openbmc_project.Common.FactoryReset", "Reset");
-        });
+    });
 }
 
 /**
@@ -266,7 +266,7 @@
         parameters.emplace_back(std::move(parameter));
 
         asyncResp->res.jsonValue["Parameters"] = std::move(parameters);
-        });
+    });
 }
 
 static constexpr const char* objectManagerIface =
@@ -686,7 +686,7 @@
                 }
             }
         }
-        });
+    });
 }
 
 enum class CreatePIDRet
@@ -806,7 +806,7 @@
                 return;
             }
             messages::success(response->res);
-            },
+        },
             "xyz.openbmc_project.EntityManager", path, iface, "Delete");
         return CreatePIDRet::del;
     }
@@ -1171,7 +1171,7 @@
                 return;
             }
             self->complete.subtree = subtreeLocal;
-            });
+        });
 
         // at the same time get the selected profile
         constexpr std::array<std::string_view, 1> thermalModeIfaces = {
@@ -1231,8 +1231,8 @@
                 }
                 self->complete.currentProfile = *current;
                 self->complete.supportedProfiles = *supported;
-                });
             });
+        });
     }
 
     static void
@@ -1381,7 +1381,7 @@
                 }
             }
             self->managedObj = mObj;
-            });
+        });
 
         // at the same time get the profile information
         constexpr std::array<std::string_view, 1> thermalModeIfaces = {
@@ -1439,8 +1439,8 @@
                 self->supportedProfiles = *supported;
                 self->profileConnection = owner;
                 self->profilePath = path;
-                });
             });
+        });
     }
     void pidSetDone()
     {
@@ -1468,7 +1468,7 @@
                     BMCWEB_LOG_ERROR("Error patching profile{}", ec);
                     messages::internalError(response->res);
                 }
-                });
+            });
         }
 
         for (auto& containerPair : configuration)
@@ -1492,9 +1492,9 @@
 
                 auto pathItr = std::ranges::find_if(
                     managedObj, [&dbusObjName](const auto& obj) {
-                        return boost::algorithm::ends_with(obj.first.str,
-                                                           "/" + dbusObjName);
-                    });
+                    return boost::algorithm::ends_with(obj.first.str,
+                                                       "/" + dbusObjName);
+                });
                 dbus::utility::DBusPropertiesMap output;
 
                 output.reserve(16); // The pid interface length
@@ -1606,7 +1606,7 @@
                                 return;
                             }
                             messages::success(response->res);
-                            });
+                        });
                     }
                 }
                 else
@@ -1647,7 +1647,7 @@
                             return;
                         }
                         messages::success(response->res);
-                        },
+                    },
                         "xyz.openbmc_project.EntityManager", chassis,
                         "xyz.openbmc_project.AddObject", "AddObject", output);
                 }
@@ -1708,7 +1708,7 @@
 
         asyncResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
             property;
-        });
+    });
 }
 // avoid name collision systems.hpp
 inline void
@@ -1735,7 +1735,7 @@
         // Convert to ISO 8601 standard
         asyncResp->res.jsonValue["LastResetTime"] =
             redfish::time_utils::getDateTimeUint(lastResetTimeStamp);
-        });
+    });
 }
 
 /**
@@ -1843,8 +1843,8 @@
                 return;
             }
             doBMCGracefulRestart(asyncResp);
-            });
         });
+    });
 }
 
 inline void setDateTime(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
@@ -1875,7 +1875,7 @@
             return;
         }
         asyncResp->res.jsonValue["DateTime"] = datetime;
-        });
+    });
 }
 
 inline void
@@ -1898,7 +1898,7 @@
         }
         asyncResp->res.jsonValue["Status"]["Health"] = "OK";
         asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
-        });
+    });
 }
 
 inline void requestRoutesManager(App& app)
@@ -2064,7 +2064,7 @@
                 return;
             }
             checkForQuiesced(asyncResp);
-            });
+        });
 
         constexpr std::array<std::string_view, 1> interfaces = {
             "xyz.openbmc_project.Inventory.Item.Bmc"};
@@ -2165,7 +2165,7 @@
                             asyncResp->res.jsonValue["SparePartNumber"] =
                                 *sparePartNumber;
                         }
-                        });
+                    });
                 }
                 else if (interfaceName ==
                          "xyz.openbmc_project.Inventory.Decorator.LocationCode")
@@ -2173,8 +2173,8 @@
                     getLocation(asyncResp, connectionName, path);
                 }
             }
-            });
         });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/")
         .privileges(redfish::privileges::patchManager)
@@ -2251,7 +2251,7 @@
         {
             setDateTime(asyncResp, std::move(*datetime));
         }
-        });
+    });
 }
 
 inline void requestRoutesManagerCollection(App& app)
@@ -2276,6 +2276,6 @@
         nlohmann::json& bmc = members.emplace_back();
         bmc["@odata.id"] = "/redfish/v1/Managers/bmc";
         asyncResp->res.jsonValue["Members"] = std::move(members);
-        });
+    });
 }
 } // namespace redfish
diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp
index 45a3789..58d51786 100644
--- a/redfish-core/lib/memory.hpp
+++ b/redfish-core/lib/memory.hpp
@@ -627,7 +627,7 @@
             return;
         }
         assembleDimmProperties(dimmId, asyncResp, properties, ""_json_pointer);
-        });
+    });
 }
 
 inline void assembleDimmPartitionData(
@@ -702,7 +702,7 @@
         }
         nlohmann::json::json_pointer regionPtr = "/Regions"_json_pointer;
         assembleDimmPartitionData(asyncResp, properties, regionPtr);
-        }
+    }
 
     );
 }
@@ -768,7 +768,7 @@
         asyncResp->res.jsonValue["@odata.id"] =
             boost::urls::format("/redfish/v1/Systems/system/Memory/{}", dimmId);
         return;
-        });
+    });
 }
 
 inline void requestRoutesMemoryCollection(App& app)
@@ -811,7 +811,7 @@
         collection_util::getCollectionMembers(
             asyncResp, boost::urls::url("/redfish/v1/Systems/system/Memory"),
             interfaces, "/xyz/openbmc_project/inventory");
-        });
+    });
 }
 
 inline void requestRoutesMemory(App& app)
@@ -846,7 +846,7 @@
         }
 
         getDimmData(asyncResp, dimmId);
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/metric_report.hpp b/redfish-core/lib/metric_report.hpp
index 7543186..3eb6927 100644
--- a/redfish-core/lib/metric_report.hpp
+++ b/redfish-core/lib/metric_report.hpp
@@ -82,7 +82,7 @@
             boost::urls::url("/redfish/v1/TelemetryService/MetricReports"),
             interfaces,
             "/xyz/openbmc_project/Telemetry/Reports/TelemetryService");
-        });
+    });
 }
 
 inline void requestRoutesMetricReport(App& app)
@@ -126,10 +126,10 @@
                 }
 
                 telemetry::fillReport(asyncResp->res.jsonValue, id, ret);
-                });
-            },
+            });
+        },
             telemetry::service, reportPath, telemetry::reportInterface,
             "Update");
-        });
+    });
 }
 } // namespace redfish
diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
index e428161..9812fce 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
@@ -748,7 +748,7 @@
             }
 
             messages::created(asyncResp->res);
-            },
+        },
             telemetry::service, "/xyz/openbmc_project/Telemetry/Reports",
             "xyz.openbmc_project.Telemetry.ReportManager", "AddReport",
             "TelemetryService/" + args.id, args.name, args.reportingType,
@@ -855,7 +855,7 @@
             {
                 return;
             }
-            },
+        },
             "xyz.openbmc_project.Telemetry", getDbusReportPath(id),
             "org.freedesktop.DBus.Properties", "Set",
             "xyz.openbmc_project.Telemetry.Report", "ReadingParameters",
@@ -900,7 +900,7 @@
         {
             return;
         }
-        },
+    },
         "xyz.openbmc_project.Telemetry", getDbusReportPath(id),
         "org.freedesktop.DBus.Properties", "Set",
         "xyz.openbmc_project.Telemetry.Report", "Enabled",
@@ -917,7 +917,7 @@
         {
             return;
         }
-        },
+    },
         "xyz.openbmc_project.Telemetry", getDbusReportPath(id),
         "xyz.openbmc_project.Telemetry.Report", "SetReportingProperties",
         reportingType, recurrenceInterval);
@@ -933,7 +933,7 @@
         {
             return;
         }
-        },
+    },
         "xyz.openbmc_project.Telemetry", getDbusReportPath(id),
         "org.freedesktop.DBus.Properties", "Set",
         "xyz.openbmc_project.Telemetry.Report", "ReportUpdates",
@@ -951,7 +951,7 @@
         {
             return;
         }
-        },
+    },
         "xyz.openbmc_project.Telemetry", getDbusReportPath(id),
         "org.freedesktop.DBus.Properties", "Set",
         "xyz.openbmc_project.Telemetry.Report", "ReportActions",
@@ -1051,9 +1051,9 @@
                     return;
                 }
                 updateMetricsReq->insert(uriToDbus);
-                });
+            });
         }
-        });
+    });
 }
 
 inline void handleMetricReportDefinitionCollectionHead(
@@ -1218,7 +1218,7 @@
             return;
         }
         asyncResp->res.result(boost::beast::http::status::no_content);
-        },
+    },
         service, reportPath, "xyz.openbmc_project.Object.Delete", "Delete");
 }
 } // namespace telemetry
@@ -1263,7 +1263,7 @@
                 return;
             }
             addReportReq->insert(uriToDbus);
-            });
+        });
     }
 }
 
@@ -1305,7 +1305,7 @@
         }
 
         telemetry::fillReportDefinition(asyncResp, id, properties);
-        });
+    });
 }
 
 inline void handleMetricReportDelete(
@@ -1341,7 +1341,7 @@
         }
 
         asyncResp->res.result(boost::beast::http::status::no_content);
-        },
+    },
         telemetry::service, reportPath, "xyz.openbmc_project.Object.Delete",
         "Delete");
 }
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index 83b6b66..151f993 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -116,7 +116,7 @@
         extractNTPServersAndDomainNamesData(dbusData, ntpServers, domainNames);
 
         callback(true, ntpServers, domainNames);
-        });
+    });
 }
 
 inline void afterNetworkPortRequest(
@@ -257,11 +257,11 @@
         "/xyz/openbmc_project/time/sync_method",
         "xyz.openbmc_project.Time.Synchronization", "TimeSyncMethod",
         timeSyncMethod, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                messages::internalError(asyncResp->res);
-            }
-        });
+        if (ec)
+        {
+            messages::internalError(asyncResp->res);
+        }
+    });
 }
 
 inline void
@@ -377,11 +377,11 @@
                             messages::internalError(asyncResp->res);
                             return;
                         }
-                        });
+                    });
                 }
             }
         }
-        });
+    });
 }
 
 inline void
@@ -417,7 +417,7 @@
                         messages::internalError(asyncResp->res);
                         return;
                     }
-                    });
+                });
                 sdbusplus::asio::setProperty(
                     *crow::connections::systemBus, entry.second.begin()->first,
                     entry.first,
@@ -429,10 +429,10 @@
                         messages::internalError(asyncResp->res);
                         return;
                     }
-                    });
+                });
             }
         }
-        });
+    });
 }
 
 inline std::string getHostName()
@@ -471,7 +471,7 @@
         {
             asyncResp->res.jsonValue["NTP"]["ProtocolEnabled"] = false;
         }
-        });
+    });
 }
 
 inline std::string encodeServiceObjectPath(std::string_view serviceName)
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index 3831e18..6bd74f9 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -67,7 +67,7 @@
                 return;
             }
             callback(pcieDevicePath, object.begin()->first);
-            });
+        });
         return;
     }
 
@@ -96,7 +96,7 @@
         handlePCIeDevicePath(pcieDeviceId, asyncResp, pcieDevicePaths,
                              callback);
         return;
-        });
+    });
 }
 
 static inline void handlePCIeDeviceCollectionGet(
@@ -254,7 +254,7 @@
             return;
         }
         callback(endpoints[0]);
-        });
+    });
 }
 
 inline void
@@ -277,7 +277,7 @@
             const boost::system::error_code& ec2,
             const dbus::utility::DBusPropertiesMap& pcieSlotProperties) {
         addPCIeSlotProperties(asyncResp->res, ec2, pcieSlotProperties);
-        });
+    });
 }
 
 inline void afterGetPCIeDeviceSlotPath(
@@ -290,7 +290,7 @@
          pcieDeviceSlot](const boost::system::error_code& ec,
                          const dbus::utility::MapperGetObject& object) {
         afterGetDbusObject(asyncResp, pcieDeviceSlot, ec, object);
-        });
+    });
 }
 
 inline void
@@ -317,7 +317,7 @@
         {
             asyncResp->res.jsonValue["Status"]["Health"] = "Critical";
         }
-        });
+    });
 }
 
 inline void
@@ -343,7 +343,7 @@
         {
             asyncResp->res.jsonValue["Status"]["State"] = "Absent";
         }
-        });
+    });
 }
 
 inline void
@@ -408,7 +408,7 @@
         {
             asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
         }
-        });
+    });
 }
 
 inline void addPCIeDeviceProperties(
@@ -521,7 +521,7 @@
             return;
         }
         callback(pcieDevProperties);
-        });
+    });
 }
 
 inline void addPCIeDeviceCommonProperties(
@@ -669,8 +669,8 @@
                 const dbus::utility::DBusPropertiesMap& pcieDevProperties) {
             addPCIeFunctionList(asyncResp->res, pcieDeviceId,
                                 pcieDevProperties);
-            });
         });
+    });
 }
 
 inline void requestRoutesSystemPCIeFunctionCollection(App& app)
@@ -823,7 +823,7 @@
                                             pcieFunctionId);
             addPCIeFunctionProperties(asyncResp->res, pcieFunctionId,
                                       pcieDevProperties);
-            });
+        });
     });
 }
 
diff --git a/redfish-core/lib/pcie_slots.hpp b/redfish-core/lib/pcie_slots.hpp
index 92ae576..b8e6389 100644
--- a/redfish-core/lib/pcie_slots.hpp
+++ b/redfish-core/lib/pcie_slots.hpp
@@ -154,7 +154,7 @@
         [asyncResp](const boost::system::error_code& ec2,
                     const dbus::utility::DBusPropertiesMap& propertiesList) {
         onPcieSlotGetAllDone(asyncResp, ec2, propertiesList);
-        });
+    });
 }
 
 inline void
@@ -204,7 +204,7 @@
                     const dbus::utility::MapperEndPoints& endpoints) {
                 onMapperAssociationDone(asyncResp, chassisID, pcieSlotPath,
                                         connectionName, ec2, endpoints);
-                });
+            });
         }
     }
 }
@@ -227,7 +227,7 @@
          chassisID](const boost::system::error_code& ec,
                     const dbus::utility::MapperGetSubTreeResponse& subtree) {
         onMapperSubtreeDone(asyncResp, chassisID, ec, subtree);
-        });
+    });
 }
 
 inline void requestRoutesPCIeSlots(App& app)
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index e7094ad..a39fab7 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -110,8 +110,8 @@
                 }
                 sensorsAsyncResp->asyncResp->res.result(
                     boost::beast::http::status::no_content);
-                });
             });
+        });
     };
     redfish::chassis_utils::getValidChassisPath(sensorsAsyncResp->asyncResp,
                                                 sensorsAsyncResp->chassisId,
@@ -300,7 +300,7 @@
 
         dbus::utility::getSubTreePaths("/xyz/openbmc_project/inventory", 0,
                                        interfaces, std::move(chassisHandler));
-        });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/Power/")
         .privileges(redfish::privileges::patchPower)
@@ -337,7 +337,7 @@
             allCollections.emplace("Voltages", *std::move(voltageCollections));
             setSensorsOverride(sensorAsyncResp, allCollections);
         }
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/power_supply.hpp b/redfish-core/lib/power_supply.hpp
index 0035b11..f59ed57 100644
--- a/redfish-core/lib/power_supply.hpp
+++ b/redfish-core/lib/power_supply.hpp
@@ -89,7 +89,7 @@
         }
 
         updatePowerSupplyList(asyncResp, chassisId, subtreePaths);
-        });
+    });
 }
 
 inline void handlePowerSupplyCollectionHead(
@@ -114,7 +114,7 @@
         asyncResp->res.addHeader(
             boost::beast::http::field::link,
             "</redfish/v1/JsonSchemas/PowerSupplyCollection/PowerSupplyCollection.json>; rel=describedby");
-        });
+    });
 }
 
 inline void handlePowerSupplyCollectionGet(
@@ -198,7 +198,7 @@
                                        powerSupplyId);
             return;
         }
-        });
+    });
 }
 
 inline void
@@ -224,7 +224,7 @@
         {
             asyncResp->res.jsonValue["Status"]["State"] = "Absent";
         }
-        });
+    });
 }
 
 inline void
@@ -250,7 +250,7 @@
         {
             asyncResp->res.jsonValue["Status"]["Health"] = "Critical";
         }
-        });
+    });
 }
 
 inline void
@@ -315,7 +315,7 @@
         {
             asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
         }
-        });
+    });
 }
 
 inline void getPowerSupplyFirmwareVersion(
@@ -338,7 +338,7 @@
             return;
         }
         asyncResp->res.jsonValue["FirmwareVersion"] = value;
-        });
+    });
 }
 
 inline void
@@ -362,7 +362,7 @@
         }
         asyncResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
             value;
-        });
+    });
 }
 
 inline void handleGetEfficiencyResponse(
@@ -431,7 +431,7 @@
         "xyz.openbmc_project.Control.PowerSupplyAttributes", "DeratingFactor",
         [asyncResp](const boost::system::error_code& ec1, uint32_t value) {
         handleGetEfficiencyResponse(asyncResp, ec1, value);
-        });
+    });
 }
 
 inline void
@@ -445,7 +445,7 @@
         [asyncResp](const boost::system::error_code& ec,
                     const dbus::utility::MapperGetSubTreeResponse& subtree) {
         handlePowerSupplyAttributesSubTreeResponse(asyncResp, ec, subtree);
-        });
+    });
 }
 
 inline void
@@ -499,7 +499,7 @@
                                           powerSupplyPath);
             getPowerSupplyLocation(asyncResp, object.begin()->first,
                                    powerSupplyPath);
-            });
+        });
 
         getEfficiencyPercent(asyncResp);
     });
@@ -533,7 +533,7 @@
                 boost::beast::http::field::link,
                 "</redfish/v1/JsonSchemas/PowerSupply/PowerSupply.json>; rel=describedby");
         });
-        });
+    });
 }
 
 inline void
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index 988d5cc..6ddc901 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -73,7 +73,7 @@
             return;
         }
         asyncResp->res.jsonValue["UUID"] = property;
-        });
+    });
 }
 
 inline void getCpuDataByInterface(
@@ -291,7 +291,7 @@
             asyncResp->res.jsonValue["TotalCores"] = totalCores;
         }
         return;
-        });
+    });
 }
 
 /**
@@ -385,7 +385,7 @@
         [asyncResp](const boost::system::error_code& ec,
                     const dbus::utility::DBusPropertiesMap& properties) {
         readThrottleProperties(asyncResp, ec, properties);
-        });
+    });
 }
 
 inline void getCpuAssetData(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
@@ -459,7 +459,7 @@
         {
             asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
         }
-        });
+    });
 }
 
 inline void getCpuRevisionData(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
@@ -495,7 +495,7 @@
         {
             asyncResp->res.jsonValue["Version"] = *version;
         }
-        });
+    });
 }
 
 inline void getAcceleratorDataByService(
@@ -549,7 +549,7 @@
         asyncResp->res.jsonValue["Status"]["State"] = state;
         asyncResp->res.jsonValue["Status"]["Health"] = health;
         asyncResp->res.jsonValue["ProcessorType"] = "Accelerator";
-        });
+    });
 }
 
 // OperatingConfig D-Bus Types
@@ -691,7 +691,7 @@
                 }
 
                 highSpeedCoreIdsHandler(asyncResp, baseSpeedList);
-                });
+            });
         }
 
         if (baseSpeedPriorityEnabled != nullptr)
@@ -699,7 +699,7 @@
             json["BaseSpeedPriorityState"] =
                 *baseSpeedPriorityEnabled ? "Enabled" : "Disabled";
         }
-        });
+    });
 }
 
 /**
@@ -729,7 +729,7 @@
 
         asyncResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
             property;
-        });
+    });
 }
 
 /**
@@ -759,7 +759,7 @@
         }
         asyncResp->res
             .jsonValue["ProcessorId"]["ProtectedIdentificationNumber"] = id;
-        });
+    });
 }
 
 /**
@@ -838,7 +838,7 @@
             return;
         }
         messages::resourceNotFound(resp->res, "Processor", processorId);
-        });
+    });
 }
 
 inline void
@@ -1001,7 +1001,7 @@
                 baseSpeedArray.emplace_back(std::move(speed));
             }
         }
-        });
+    });
 }
 
 /**
@@ -1128,7 +1128,7 @@
         [resp, appliedConfigUri](const boost::system::error_code& ec,
                                  const sdbusplus::message_t& msg) {
         handleAppliedConfigResponse(resp, appliedConfigUri, ec, msg);
-        });
+    });
 }
 
 inline void
@@ -1224,9 +1224,8 @@
 
                 // Use the common search routine to construct the
                 // Collection of all Config objects under this CPU.
-                constexpr std::array<std::string_view, 1> interface {
-                    "xyz.openbmc_project.Inventory.Item.Cpu.OperatingConfig"
-                };
+                constexpr std::array<std::string_view, 1> interface{
+                    "xyz.openbmc_project.Inventory.Item.Cpu.OperatingConfig"};
                 collection_util::getCollectionMembers(
                     asyncResp,
                     boost::urls::format(
@@ -1235,8 +1234,8 @@
                     interface, object);
                 return;
             }
-            });
         });
+    });
 }
 
 inline void requestRoutesOperatingConfig(App& app)
@@ -1309,8 +1308,8 @@
             }
             messages::resourceNotFound(asyncResp->res, "OperatingConfig",
                                        configName);
-            });
         });
+    });
 }
 
 inline void requestRoutesProcessorCollection(App& app)
@@ -1363,7 +1362,7 @@
             asyncResp,
             boost::urls::url("/redfish/v1/Systems/system/Processors"),
             processorInterfaces, "/xyz/openbmc_project/inventory");
-        });
+    });
 }
 
 inline void requestRoutesProcessor(App& app)
@@ -1413,7 +1412,7 @@
         getProcessorObject(
             asyncResp, processorId,
             std::bind_front(getProcessorData, asyncResp, processorId));
-        });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/Processors/<str>/")
         .privileges(redfish::privileges::patchProcessor)
@@ -1463,7 +1462,7 @@
                                                asyncResp, processorId,
                                                appliedConfigUri));
         }
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/redfish_util.hpp b/redfish-core/lib/redfish_util.hpp
index 4806cb4..7a96481 100644
--- a/redfish-core/lib/redfish_util.hpp
+++ b/redfish-core/lib/redfish_util.hpp
@@ -94,7 +94,7 @@
         std::string chassisId = subtree[0].first.substr(idPos + 1);
         BMCWEB_LOG_DEBUG("chassisId = {}", chassisId);
         callback(chassisId, asyncResp);
-        });
+    });
 }
 
 template <typename CallbackFunc>
@@ -171,7 +171,7 @@
                     socketData,
                     [&kv](const std::tuple<std::string, std::string, bool>& i) {
                     return std::get<1>(i) == kv.first;
-                    });
+                });
                 if (find != socketData.end())
                 {
                     // It only takes one enabled systemd service to consider a
@@ -199,7 +199,7 @@
         }
 
         callback(ec, socketData);
-        },
+    },
         "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
         "org.freedesktop.systemd1.Manager", "ListUnits");
 }
@@ -253,7 +253,7 @@
             BMCWEB_LOG_ERROR("{}", ec3);
         }
         callback(ec, port);
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/roles.hpp b/redfish-core/lib/roles.hpp
index 784f716..7cd55b2 100644
--- a/redfish-core/lib/roles.hpp
+++ b/redfish-core/lib/roles.hpp
@@ -97,7 +97,7 @@
         asyncResp->res.jsonValue["@odata.id"] =
             boost::urls::format("/redfish/v1/AccountService/Roles/{}", roleId);
         asyncResp->res.jsonValue["AssignedPrivileges"] = std::move(privArray);
-        });
+    });
 }
 
 inline void requestRoutesRoleCollection(App& app)
@@ -145,8 +145,8 @@
             }
             asyncResp->res.jsonValue["Members@odata.count"] =
                 memberArray.size();
-            });
         });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index f1cf96c..aec1ebe 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -410,7 +410,7 @@
         BMCWEB_LOG_DEBUG("Found {} connections", connections.size());
         callback(std::move(connections), std::move(objectsWithConnection));
         BMCWEB_LOG_DEBUG("getObjectsWithConnection resp_handler exit");
-        });
+    });
     BMCWEB_LOG_DEBUG("getObjectsWithConnection exit");
 }
 
@@ -587,8 +587,8 @@
                              &nodeSensorList, culledSensorList);
             BMCWEB_LOG_DEBUG("Finishing with {}", culledSensorList->size());
             callback(culledSensorList);
-            });
         });
+    });
     BMCWEB_LOG_DEBUG("getChassis exit");
 }
 
@@ -1019,9 +1019,9 @@
                 }
                 auto found = std::ranges::find_if(
                     endpoints, [sensorsAsyncResp](const std::string& entry) {
-                        return entry.find(sensorsAsyncResp->chassisId) !=
-                               std::string::npos;
-                    });
+                    return entry.find(sensorsAsyncResp->chassisId) !=
+                           std::string::npos;
+                });
 
                 if (found == endpoints.end())
                 {
@@ -1106,8 +1106,8 @@
                                      itemName.end(), '_', ' ');*/
                         auto schemaItem = std::ranges::find_if(
                             fanRedfish, [itemName](const nlohmann::json& fan) {
-                                return fan["Name"] == itemName;
-                            });
+                            return fan["Name"] == itemName;
+                        });
                         if (schemaItem != fanRedfish.end())
                         {
                             nlohmann::json::object_t collectionId;
@@ -1149,10 +1149,10 @@
                     redundancy["Status"]["State"] = "Enabled";
 
                     jResp.emplace_back(std::move(redundancy));
-                    });
                 });
+            });
         }
-        });
+    });
 }
 
 inline void
@@ -1486,7 +1486,7 @@
                                   invConnectionsIndex + 1);
 
             BMCWEB_LOG_DEBUG("getInventoryItemsData respHandler exit");
-            });
+        });
     }
 
     BMCWEB_LOG_DEBUG("getInventoryItemsData exit");
@@ -1568,7 +1568,7 @@
 
         callback(invConnections);
         BMCWEB_LOG_DEBUG("getInventoryItemsConnections respHandler exit");
-        });
+    });
     BMCWEB_LOG_DEBUG("getInventoryItemsConnections exit");
 }
 
@@ -1712,7 +1712,7 @@
         }
         callback(inventoryItems);
         BMCWEB_LOG_DEBUG("getInventoryItemAssociations respHandler exit");
-        });
+    });
 
     BMCWEB_LOG_DEBUG("getInventoryItemAssociations exit");
 }
@@ -1902,7 +1902,7 @@
         getInventoryLedData(sensorsAsyncResp, inventoryItems, ledConnections,
                             std::move(callback));
         BMCWEB_LOG_DEBUG("getInventoryLeds respHandler exit");
-        });
+    });
     BMCWEB_LOG_DEBUG("getInventoryLeds exit");
 }
 
@@ -1953,10 +1953,10 @@
     const std::string& psAttributesConnection = (*it).second;
 
     // Response handler for Get DeratingFactor property
-    auto respHandler =
-        [sensorsAsyncResp, inventoryItems,
-         callback{std::forward<Callback>(callback)}](
-            const boost::system::error_code& ec, const uint32_t value) {
+    auto respHandler = [sensorsAsyncResp, inventoryItems,
+                        callback{std::forward<Callback>(callback)}](
+                           const boost::system::error_code& ec,
+                           const uint32_t value) {
         BMCWEB_LOG_DEBUG("getPowerSupplyAttributesData respHandler enter");
         if (ec)
         {
@@ -2086,7 +2086,7 @@
                                      psAttributesConnections,
                                      std::move(callback));
         BMCWEB_LOG_DEBUG("getPowerSupplyAttributes respHandler exit");
-        });
+    });
     BMCWEB_LOG_DEBUG("getPowerSupplyAttributes exit");
 }
 
@@ -2473,7 +2473,7 @@
                 }
             }
             BMCWEB_LOG_DEBUG("getManagedObjectsCb exit");
-            });
+        });
     }
     BMCWEB_LOG_DEBUG("getSensorData exit");
 }
@@ -2717,7 +2717,7 @@
                         messages::internalError(
                             sensorAsyncResp->asyncResp->res);
                     }
-                    });
+                });
             }
         };
         // Get object with connection for the given sensor name
@@ -2878,7 +2878,7 @@
         std::string type = path.filename();
         objectPropertiesToJson(name, type, sensors::node::sensors, valuesDict,
                                asyncResp->res.jsonValue, nullptr);
-        });
+    });
 }
 
 inline void handleSensorGet(App& app, const crow::Request& req,
@@ -2930,7 +2930,7 @@
         }
         getSensorFromDbus(asyncResp, sensorPath, subtree);
         BMCWEB_LOG_DEBUG("respHandler1 exit");
-        });
+    });
 }
 
 } // namespace sensors
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
index 74c88f7..9f3512f 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -64,9 +64,8 @@
         "/redfish/v1/Systems/system/Storage";
     asyncResp->res.jsonValue["Name"] = "Storage Collection";
 
-    constexpr std::array<std::string_view, 1> interface {
-        "xyz.openbmc_project.Inventory.Item.Storage"
-    };
+    constexpr std::array<std::string_view, 1> interface{
+        "xyz.openbmc_project.Inventory.Item.Storage"};
     collection_util::getCollectionMembers(
         asyncResp, boost::urls::format("/redfish/v1/Systems/system/Storage"),
         interface, "/xyz/openbmc_project/inventory");
@@ -84,9 +83,8 @@
         "#StorageCollection.StorageCollection";
     asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Storage";
     asyncResp->res.jsonValue["Name"] = "Storage Collection";
-    constexpr std::array<std::string_view, 1> interface {
-        "xyz.openbmc_project.Inventory.Item.Storage"
-    };
+    constexpr std::array<std::string_view, 1> interface{
+        "xyz.openbmc_project.Inventory.Item.Storage"};
     collection_util::getCollectionMembers(
         asyncResp, boost::urls::format("/redfish/v1/Storage"), interface,
         "/xyz/openbmc_project/inventory");
@@ -174,7 +172,7 @@
                                      dbus::utility::MapperServiceMap>& object) {
         return sdbusplus::message::object_path(object.first).filename() ==
                storageId;
-        });
+    });
     if (storage == subtree.end())
     {
         messages::resourceNotFound(asyncResp->res, "#Storage.v1_13_0.Storage",
@@ -243,7 +241,7 @@
                                      dbus::utility::MapperServiceMap>& object) {
         return sdbusplus::message::object_path(object.first).filename() ==
                storageId;
-        });
+    });
     if (storage == subtree.end())
     {
         messages::resourceNotFound(asyncResp->res, "#Storage.v1_13_0.Storage",
@@ -352,7 +350,7 @@
         {
             asyncResp->res.jsonValue["Model"] = *model;
         }
-        });
+    });
 }
 
 inline void getDrivePresent(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -375,7 +373,7 @@
         {
             asyncResp->res.jsonValue["Status"]["State"] = "Absent";
         }
-        });
+    });
 }
 
 inline void getDriveState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -401,7 +399,7 @@
         {
             asyncResp->res.jsonValue["Status"]["State"] = "Updating";
         }
-        });
+    });
 }
 
 inline std::optional<drive::MediaType> convertDriveType(std::string_view type)
@@ -612,7 +610,7 @@
         // to the user in unencrypted form."
         asyncResp->res.jsonValue["EncryptionStatus"] =
             drive::EncryptionStatus::Unlocked;
-        });
+    });
 }
 
 static void addAllDriveInfo(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -659,7 +657,7 @@
                                    dbus::utility::MapperServiceMap>& object) {
         return sdbusplus::message::object_path(object.first).filename() ==
                driveId;
-        });
+    });
 
     if (drive == subtree.end())
     {
@@ -813,9 +811,9 @@
                 // navigation links will be registered in next patch set
             }
             asyncResp->res.jsonValue["Members@odata.count"] = resp.size();
-            }); // end association lambda
+        }); // end association lambda
 
-    }           // end Iterate over all retrieved ObjectPaths
+    }       // end Iterate over all retrieved ObjectPaths
 }
 /**
  * Chassis drives, this URL will show all the DriveCollection
@@ -919,7 +917,7 @@
                 const boost::system::error_code& ec,
                 const dbus::utility::MapperGetSubTreeResponse& subtree) {
             buildDrive(asyncResp, chassisId, driveName, ec, subtree);
-            });
+        });
     }
 }
 
@@ -974,10 +972,10 @@
                     return; // no drives = no failures
                 }
                 matchAndFillDrive(asyncResp, chassisId, driveName, resp);
-                });
+            });
             break;
         }
-        });
+    });
 }
 
 /**
@@ -1066,7 +1064,7 @@
         {
             asyncResp->res.jsonValue["Status"]["State"] = "Absent";
         }
-        });
+    });
 
     sdbusplus::asio::getAllProperties(
         *crow::connections::systemBus, connectionName, path,
@@ -1076,7 +1074,7 @@
                         std::pair<std::string, dbus::utility::DbusVariantType>>&
                         propertiesList) {
         getStorageControllerAsset(asyncResp, ec, propertiesList);
-        });
+    });
 }
 
 inline void getStorageControllerHandler(
@@ -1183,7 +1181,7 @@
                     const dbus::utility::MapperGetSubTreePathsResponse&
                         controllerList) {
         populateStorageControllerCollection(asyncResp, ec, controllerList);
-        });
+    });
 }
 
 inline void handleSystemsStorageControllerGet(
@@ -1211,7 +1209,7 @@
          controllerId](const boost::system::error_code& ec,
                        const dbus::utility::MapperGetSubTreeResponse& subtree) {
         getStorageControllerHandler(asyncResp, controllerId, ec, subtree);
-        });
+    });
 }
 
 inline void requestRoutesStorageControllerCollection(App& app)
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 4502226..d8cf644 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -238,7 +238,7 @@
             return;
         }
         getProcessorProperties(asyncResp, properties);
-        });
+    });
 }
 
 /*
@@ -276,7 +276,7 @@
                     return;
                 }
                 updateDimmProperties(asyncResp, dimmState);
-                });
+            });
         }
         return;
     }
@@ -343,7 +343,7 @@
             return;
         }
         processMemoryProperties(asyncResp, service, path, properties);
-        });
+    });
 }
 
 /*
@@ -485,7 +485,7 @@
                                 BMCWEB_LOG_DEBUG("UUID = {}", valueStr);
                                 asyncResp->res.jsonValue["UUID"] = valueStr;
                             }
-                            });
+                        });
                     }
                     else if (interfaceName ==
                              "xyz.openbmc_project.Inventory.Item.System")
@@ -559,7 +559,7 @@
                             sw_util::populateSoftwareInformation(
                                 asyncResp, sw_util::biosPurpose, "BiosVersion",
                                 false);
-                            });
+                        });
 
                         sdbusplus::asio::getProperty<std::string>(
                             *crow::connections::systemBus, connection.first,
@@ -577,12 +577,12 @@
                             }
 
                             asyncResp->res.jsonValue["AssetTag"] = value;
-                            });
+                        });
                     }
                 }
             }
         }
-        });
+    });
 }
 
 /**
@@ -652,7 +652,7 @@
             asyncResp->res.jsonValue["PowerState"] = "Off";
             asyncResp->res.jsonValue["Status"]["State"] = "Disabled";
         }
-        });
+    });
 }
 
 /**
@@ -901,7 +901,7 @@
 
         asyncResp->res.jsonValue["BootProgress"]["LastState"] =
             dbusToRfBootProgress(bootProgressStr);
-        });
+    });
 }
 
 /**
@@ -935,7 +935,7 @@
         // Convert to ISO 8601 standard
         asyncResp->res.jsonValue["BootProgress"]["LastStateTime"] =
             redfish::time_utils::getDateTimeUintUs(lastStateTime);
-        });
+    });
 }
 
 /**
@@ -976,7 +976,7 @@
         }
 
         asyncResp->res.jsonValue["Boot"]["BootSourceOverrideMode"] = rfType;
-        });
+    });
 }
 
 /**
@@ -1020,7 +1020,7 @@
                     rfMode;
             }
         }
-        });
+    });
 }
 
 /**
@@ -1063,7 +1063,7 @@
         // Get BootMode as BootSourceOverrideTarget is constructed
         // from both BootSource and BootMode
         getBootOverrideMode(asyncResp);
-        });
+    });
 }
 
 /**
@@ -1111,7 +1111,7 @@
             asyncResp->res.jsonValue["Boot"]["BootSourceOverrideEnabled"] =
                 "Continuous";
         }
-        });
+    });
 }
 
 /**
@@ -1143,7 +1143,7 @@
         }
 
         processBootOverrideEnable(asyncResp, bootOverrideEnable);
-        });
+    });
 }
 
 /**
@@ -1199,7 +1199,7 @@
         // Convert to ISO 8601 standard
         asyncResp->res.jsonValue["LastResetTime"] =
             redfish::time_utils::getDateTimeUint(lastResetTimeStamp);
-        });
+    });
 }
 
 /**
@@ -1261,7 +1261,7 @@
             asyncResp->res.jsonValue["Boot"]["AutomaticRetryAttempts"] =
                 *retryAttempts;
         }
-        });
+    });
 }
 
 /**
@@ -1311,7 +1311,7 @@
         asyncResp->res
             .jsonValue["Boot"]["AutomaticRetryConfig@Redfish.AllowableValues"] =
             {"Disabled", "RetryAttempts"};
-        });
+    });
 }
 
 /**
@@ -1333,14 +1333,14 @@
         "/xyz/openbmc_project/state/host0",
         "xyz.openbmc_project.Control.Boot.RebootAttempts", "RetryAttempts",
         retryAttempts, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                BMCWEB_LOG_ERROR(
-                    "DBUS response error: Set setAutomaticRetryAttempts{}", ec);
-                messages::internalError(asyncResp->res);
-                return;
-            }
-        });
+        if (ec)
+        {
+            BMCWEB_LOG_ERROR(
+                "DBUS response error: Set setAutomaticRetryAttempts{}", ec);
+            messages::internalError(asyncResp->res);
+            return;
+        }
+    });
 }
 
 inline computer_system::PowerRestorePolicyTypes
@@ -1399,7 +1399,7 @@
         }
 
         asyncResp->res.jsonValue["PowerRestorePolicy"] = restore;
-        });
+    });
 }
 
 /**
@@ -1437,7 +1437,7 @@
         {
             asyncResp->res.jsonValue["Boot"]["StopBootOnFault"] = "Never";
         }
-        });
+    });
 }
 
 /**
@@ -1522,8 +1522,8 @@
                     .jsonValue["Boot"]["TrustedModuleRequiredToBoot"] =
                     "Disabled";
             }
-            });
         });
+    });
 }
 
 /**
@@ -1604,8 +1604,8 @@
                 return;
             }
             BMCWEB_LOG_DEBUG("Set TrustedModuleRequiredToBoot done.");
-            });
         });
+    });
 }
 
 /**
@@ -1666,7 +1666,7 @@
             return;
         }
         BMCWEB_LOG_DEBUG("Boot type update done.");
-        });
+    });
 }
 
 /**
@@ -1729,7 +1729,7 @@
             return;
         }
         BMCWEB_LOG_DEBUG("Boot override enable update done.");
-        });
+    });
 
     if (!bootOverrideEnable)
     {
@@ -1753,7 +1753,7 @@
             return;
         }
         BMCWEB_LOG_DEBUG("Boot one_time update done.");
-        });
+    });
 }
 
 /**
@@ -1806,7 +1806,7 @@
             return;
         }
         BMCWEB_LOG_DEBUG("Boot source update done.");
-        });
+    });
 
     sdbusplus::asio::setProperty(
         *crow::connections::systemBus, "xyz.openbmc_project.Settings",
@@ -1820,7 +1820,7 @@
             return;
         }
         BMCWEB_LOG_DEBUG("Boot mode update done.");
-        });
+    });
 }
 
 /**
@@ -1906,15 +1906,15 @@
             *crow::connections::systemBus, service, path,
             "xyz.openbmc_project.Inventory.Decorator.AssetTag", "AssetTag",
             assetTag, [asyncResp](const boost::system::error_code& ec2) {
-                if (ec2)
-                {
-                    BMCWEB_LOG_ERROR("D-Bus response error on AssetTag Set {}",
-                                     ec2);
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
-            });
+            if (ec2)
+            {
+                BMCWEB_LOG_ERROR("D-Bus response error on AssetTag Set {}",
+                                 ec2);
+                messages::internalError(asyncResp->res);
+                return;
+            }
         });
+    });
 }
 
 /**
@@ -1971,16 +1971,16 @@
         "/xyz/openbmc_project/logging/settings",
         "xyz.openbmc_project.Logging.Settings", "QuiesceOnHwError",
         *stopBootEnabled, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
+        if (ec)
+        {
+            if (ec.value() != EBADR)
             {
-                if (ec.value() != EBADR)
-                {
-                    BMCWEB_LOG_ERROR("DBUS response error {}", ec);
-                    messages::internalError(asyncResp->res);
-                }
-                return;
+                BMCWEB_LOG_ERROR("DBUS response error {}", ec);
+                messages::internalError(asyncResp->res);
             }
-        });
+            return;
+        }
+    });
 }
 
 /**
@@ -2022,13 +2022,13 @@
         "/xyz/openbmc_project/control/host0/auto_reboot",
         "xyz.openbmc_project.Control.Boot.RebootPolicy", "AutoReboot",
         autoRebootEnabled, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                BMCWEB_LOG_ERROR("DBUS response error {}", ec);
-                messages::internalError(asyncResp->res);
-                return;
-            }
-        });
+        if (ec)
+        {
+            BMCWEB_LOG_ERROR("DBUS response error {}", ec);
+            messages::internalError(asyncResp->res);
+            return;
+        }
+    });
 }
 
 inline std::string dbusPowerRestorePolicyFromRedfish(std::string_view policy)
@@ -2076,13 +2076,13 @@
         "/xyz/openbmc_project/control/host0/power_restore_policy",
         "xyz.openbmc_project.Control.Power.RestorePolicy", "PowerRestorePolicy",
         powerRestorePolicy, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                BMCWEB_LOG_ERROR("DBUS response error {}", ec);
-                messages::internalError(asyncResp->res);
-                return;
-            }
-        });
+        if (ec)
+        {
+            BMCWEB_LOG_ERROR("DBUS response error {}", ec);
+            messages::internalError(asyncResp->res);
+            return;
+        }
+    });
 }
 
 #ifdef BMCWEB_ENABLE_REDFISH_PROVISIONING_FEATURE
@@ -2150,7 +2150,7 @@
         {
             oemPFR["ProvisioningStatus"] = "NotProvisioned";
         }
-        });
+    });
 }
 #endif
 
@@ -2269,8 +2269,8 @@
 
             BMCWEB_LOG_DEBUG("Current power mode: {}", pmode);
             translatePowerMode(asyncResp, pmode);
-            });
         });
+    });
 }
 
 /**
@@ -2389,8 +2389,8 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            });
         });
+    });
 }
 
 /**
@@ -2514,7 +2514,7 @@
             }
             hostWatchdogTimer["TimeoutAction"] = action;
         }
-        });
+    });
 }
 
 /**
@@ -2552,13 +2552,13 @@
             "/xyz/openbmc_project/watchdog/host0",
             "xyz.openbmc_project.State.Watchdog", "ExpireAction",
             wdtTimeOutActStr, [asyncResp](const boost::system::error_code& ec) {
-                if (ec)
-                {
-                    BMCWEB_LOG_ERROR("DBUS response error {}", ec);
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
-            });
+            if (ec)
+            {
+                BMCWEB_LOG_ERROR("DBUS response error {}", ec);
+                messages::internalError(asyncResp->res);
+                return;
+            }
+        });
     }
 
     if (wdtEnable)
@@ -2574,7 +2574,7 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            });
+        });
     }
 }
 
@@ -2721,8 +2721,8 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            });
         });
+    });
 
     BMCWEB_LOG_DEBUG("EXIT: Get idle power saver parameters");
 }
@@ -2809,13 +2809,13 @@
                 *crow::connections::systemBus, service, path,
                 "xyz.openbmc_project.Control.Power.IdlePowerSaver", "Enabled",
                 *ipsEnable, [asyncResp](const boost::system::error_code& ec2) {
-                    if (ec2)
-                    {
-                        BMCWEB_LOG_ERROR("DBUS response error {}", ec2);
-                        messages::internalError(asyncResp->res);
-                        return;
-                    }
-                });
+                if (ec2)
+                {
+                    BMCWEB_LOG_ERROR("DBUS response error {}", ec2);
+                    messages::internalError(asyncResp->res);
+                    return;
+                }
+            });
         }
         if (ipsEnterUtil)
         {
@@ -2830,7 +2830,7 @@
                     messages::internalError(asyncResp->res);
                     return;
                 }
-                });
+            });
         }
         if (ipsEnterTime)
         {
@@ -2847,7 +2847,7 @@
                     messages::internalError(asyncResp->res);
                     return;
                 }
-                });
+            });
         }
         if (ipsExitUtil)
         {
@@ -2862,7 +2862,7 @@
                     messages::internalError(asyncResp->res);
                     return;
                 }
-                });
+            });
         }
         if (ipsExitTime)
         {
@@ -2879,9 +2879,9 @@
                     messages::internalError(asyncResp->res);
                     return;
                 }
-                });
+            });
         }
-        });
+    });
 
     BMCWEB_LOG_DEBUG("EXIT: Set idle power saver parameters");
 }
@@ -2956,7 +2956,7 @@
         nlohmann::json::object_t hypervisor;
         hypervisor["@odata.id"] = "/redfish/v1/Systems/hypervisor";
         ifaceArray2.emplace_back(std::move(hypervisor));
-        });
+    });
 }
 
 /**
@@ -2979,7 +2979,7 @@
             return;
         }
         messages::success(asyncResp->res);
-        },
+    },
         serviceName, objectPath, interfaceName, method);
 }
 
@@ -3113,7 +3113,7 @@
                 return;
             }
             messages::success(asyncResp->res);
-            });
+        });
     }
     else
     {
@@ -3131,7 +3131,7 @@
                 return;
             }
             messages::success(asyncResp->res);
-            });
+        });
     }
 }
 
@@ -3307,7 +3307,7 @@
             }
 
             health->inventory = resp;
-            });
+        });
         health->populate();
     }
 
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index 40e1a51..136412c 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -298,7 +298,7 @@
                     [self] { self->match.reset(); });
                 return;
             }
-            });
+        });
 
         extendTimer(timeout);
         messages.emplace_back(messages::taskStarted(std::to_string(index)));
@@ -348,7 +348,7 @@
             // we compare against the string version as on failure
             // strtoul returns 0
             return std::to_string(task->index) == strParam;
-            });
+        });
 
         if (find == task::tasks.end())
         {
@@ -363,7 +363,7 @@
             return;
         }
         ptr->populateResp(asyncResp->res);
-        });
+    });
 }
 
 inline void requestRoutesTask(App& app)
@@ -389,7 +389,7 @@
             // we compare against the string version as on failure
             // strtoul returns 0
             return std::to_string(task->index) == strParam;
-            });
+        });
 
         if (find == task::tasks.end())
         {
@@ -433,7 +433,7 @@
                 2, ' ', true, nlohmann::json::error_handler_t::replace);
         }
         asyncResp->res.jsonValue["PercentComplete"] = ptr->percentComplete;
-        });
+    });
 }
 
 inline void requestRoutesTaskCollection(App& app)
@@ -467,7 +467,7 @@
                                     std::to_string(task->index));
             members.emplace_back(std::move(member));
         }
-        });
+    });
 }
 
 inline void requestRoutesTaskService(App& app)
@@ -501,7 +501,7 @@
         asyncResp->res.jsonValue["ServiceEnabled"] = true;
         asyncResp->res.jsonValue["Tasks"]["@odata.id"] =
             "/redfish/v1/TaskService/Tasks";
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp
index 42e66c9..724e8aa 100644
--- a/redfish-core/lib/telemetry_service.hpp
+++ b/redfish-core/lib/telemetry_service.hpp
@@ -87,7 +87,7 @@
 
         asyncResp->res.jsonValue["SupportedCollectionFunctions"] =
             std::move(supportedCollectionFunctions);
-        });
+    });
 }
 
 inline void requestRoutesTelemetryService(App& app)
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index cc548e1..9d057f2 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -42,7 +42,7 @@
 
         // TODO Need to get Chassis Redundancy information.
         getChassisData(sensorAsyncResp);
-        });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/Thermal/")
         .privileges(redfish::privileges::patchThermal)
@@ -86,7 +86,7 @@
             allCollections.emplace("Fans", *std::move(fanCollections));
         }
         setSensorsOverride(sensorsAsyncResp, allCollections);
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/trigger.hpp b/redfish-core/lib/trigger.hpp
index 3388580..a6d2254 100644
--- a/redfish-core/lib/trigger.hpp
+++ b/redfish-core/lib/trigger.hpp
@@ -942,7 +942,7 @@
         [asyncResp, id = ctx.id](const boost::system::error_code& ec,
                                  const std::string& dbusPath) {
         afterCreateTrigger(ec, dbusPath, asyncResp, id);
-        },
+    },
         service, "/xyz/openbmc_project/Telemetry/Triggers",
         "xyz.openbmc_project.Telemetry.TriggerManager", "AddTrigger",
         "TelemetryService/" + ctx.id, ctx.name, ctx.actions, ctx.sensors,
@@ -974,7 +974,7 @@
             boost::urls::url("/redfish/v1/TelemetryService/Triggers"),
             interfaces,
             "/xyz/openbmc_project/Telemetry/Triggers/TelemetryService");
-        });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/TelemetryService/Triggers/")
         .privileges(redfish::privileges::postTriggersCollection)
@@ -1018,8 +1018,8 @@
             {
                 messages::internalError(asyncResp->res);
             }
-            });
         });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/TelemetryService/Triggers/<str>/")
         .privileges(redfish::privileges::deleteTriggers)
@@ -1049,10 +1049,10 @@
             }
 
             asyncResp->res.result(boost::beast::http::status::no_content);
-            },
+        },
             telemetry::service, triggerPath,
             "xyz.openbmc_project.Object.Delete", "Delete");
-        });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index caaa694..2f0cc47 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -74,7 +74,7 @@
             BMCWEB_LOG_DEBUG("error_code = {}", ec);
             BMCWEB_LOG_DEBUG("error msg = {}", ec.message());
         }
-        });
+    });
 }
 
 // Note that asyncResp can be either a valid pointer or nullptr. If nullptr
@@ -248,7 +248,7 @@
                         // unless it is an error
 
                         return !task::completed;
-                            },
+                    },
                             "type='signal',interface='org.freedesktop.DBus.Properties',"
                             "member='PropertiesChanged',path='" +
                                 objPath.str + "'");
@@ -257,7 +257,7 @@
                     task->payload.emplace(std::move(payload));
                 }
                 fwUpdateInProgress = false;
-                });
+            });
 
             break;
         }
@@ -549,13 +549,13 @@
             {
                 BMCWEB_LOG_DEBUG("Call to DownloaViaTFTP Success");
             }
-            },
+        },
             "xyz.openbmc_project.Software.Download",
             "/xyz/openbmc_project/software", "xyz.openbmc_project.Common.TFTP",
             "DownloadViaTFTP", fwFile, tftpServer);
 
         BMCWEB_LOG_DEBUG("Exit UpdateService.SimpleUpdate doPost");
-        });
+    });
 }
 
 inline void uploadImageFile(crow::Response& res, std::string_view body)
@@ -607,14 +607,14 @@
         "/xyz/openbmc_project/software/apply_time",
         "xyz.openbmc_project.Software.ApplyTime", "RequestedApplyTime",
         applyTimeNewVal, [asyncResp](const boost::system::error_code& ec) {
-            if (ec)
-            {
-                BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            messages::success(asyncResp->res);
-        });
+        if (ec)
+        {
+            BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
+            messages::internalError(asyncResp->res);
+            return;
+        }
+        messages::success(asyncResp->res);
+    });
 }
 
 inline void
@@ -816,8 +816,8 @@
                                         ["HttpPushUriApplyTime"]["ApplyTime"] =
                     "OnReset";
             }
-            });
         });
+    });
     BMCWEB_ROUTE(app, "/redfish/v1/UpdateService/")
         .privileges(redfish::privileges::patchUpdateService)
         .methods(boost::beast::http::verb::patch)(
@@ -860,7 +860,7 @@
                 }
             }
         }
-        });
+    });
 
     BMCWEB_ROUTE(app, "/redfish/v1/UpdateService/update/")
         .privileges(redfish::privileges::postUpdateService)
@@ -891,7 +891,7 @@
             asyncResp,
             boost::urls::url("/redfish/v1/UpdateService/FirmwareInventory"),
             iface, "/xyz/openbmc_project/software");
-        });
+    });
 }
 /* Fill related item links (i.e. bmc, bios) in for inventory */
 inline static void
@@ -991,7 +991,7 @@
         std::string formatDesc = swInvPurpose->substr(endDesc);
         asyncResp->res.jsonValue["Description"] = formatDesc + " image";
         getRelatedItems(asyncResp, *swInvPurpose);
-        });
+    });
 }
 
 inline void requestRoutesSoftwareInventory(App& app)
@@ -1065,8 +1065,8 @@
 
             asyncResp->res.jsonValue["Updateable"] = false;
             sw_util::getSwUpdatableStatus(asyncResp, swId);
-            });
         });
+    });
 }
 
 } // namespace redfish
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
index 95cbdf1..9784d37 100644
--- a/redfish-core/lib/virtual_media.hpp
+++ b/redfish-core/lib/virtual_media.hpp
@@ -120,7 +120,7 @@
 
         BMCWEB_LOG_DEBUG("Parent item not found");
         asyncResp->res.result(boost::beast::http::status::not_found);
-        });
+    });
 }
 
 /**
@@ -303,7 +303,7 @@
             members.emplace_back(std::move(item));
         }
         asyncResp->res.jsonValue["Members@odata.count"] = members.size();
-        });
+    });
 }
 
 inline void
@@ -481,7 +481,7 @@
                 BMCWEB_LOG_ERROR("Failed to pass secret: {}", ec);
                 messages::internalError(asyncResp->res);
             }
-            });
+        });
     }
 
     dbus::utility::DbusVariantType unixFd(
@@ -504,7 +504,7 @@
             BMCWEB_LOG_ERROR("Service responded with error");
             messages::internalError(asyncResp->res);
         }
-        },
+    },
         service, path.str, "xyz.openbmc_project.VirtualMedia.Legacy", "Mount",
         imageUrl, rw, unixFd);
 }
@@ -669,7 +669,7 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            },
+        },
             service, "/xyz/openbmc_project/VirtualMedia/Legacy/" + name,
             "xyz.openbmc_project.VirtualMedia.Legacy", "Unmount");
     }
@@ -684,7 +684,7 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            },
+        },
             service, "/xyz/openbmc_project/VirtualMedia/Proxy/" + name,
             "xyz.openbmc_project.VirtualMedia.Proxy", "Unmount");
     }
@@ -765,8 +765,8 @@
             }
             BMCWEB_LOG_DEBUG("Parent item not found");
             messages::resourceNotFound(asyncResp->res, "VirtualMedia", resName);
-            });
         });
+    });
 }
 
 inline void handleManagersVirtualMediaActionEject(
@@ -828,8 +828,8 @@
             }
             BMCWEB_LOG_DEBUG("Parent item not found");
             messages::resourceNotFound(asyncResp->res, "VirtualMedia", resName);
-            });
         });
+    });
 }
 
 inline void handleManagersVirtualMediaCollectionGet(
@@ -869,7 +869,7 @@
         BMCWEB_LOG_DEBUG("GetObjectType: {}", service);
 
         getVmResourceList(asyncResp, service, name);
-        });
+    });
 }
 
 inline void
@@ -904,7 +904,7 @@
         BMCWEB_LOG_DEBUG("GetObjectType: {}", service);
 
         getVmData(asyncResp, service, name, resName);
-        });
+    });
 }
 
 inline void requestNBDVirtualMediaRoutes(App& app)
diff --git a/redfish-core/src/registries.cpp b/redfish-core/src/registries.cpp
index e465b15..c727d1c 100644
--- a/redfish-core/src/registries.cpp
+++ b/redfish-core/src/registries.cpp
@@ -16,8 +16,8 @@
 {
     std::span<const MessageEntry>::iterator messageIt = std::ranges::find_if(
         registry, [&messageKey](const MessageEntry& messageEntry) {
-            return std::strcmp(messageEntry.first, messageKey.c_str()) == 0;
-        });
+        return std::strcmp(messageEntry.first, messageKey.c_str()) == 0;
+    });
     if (messageIt != registry.end())
     {
         return &messageIt->second;
