diff --git a/libpldmresponder/base.hpp b/libpldmresponder/base.hpp
index ad41299..b0829c4 100644
--- a/libpldmresponder/base.hpp
+++ b/libpldmresponder/base.hpp
@@ -25,23 +25,23 @@
         handlers.emplace(
             PLDM_GET_PLDM_TYPES,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getPLDMTypes(request, payloadLength);
-        });
+                return this->getPLDMTypes(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_GET_PLDM_COMMANDS,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getPLDMCommands(request, payloadLength);
-        });
+                return this->getPLDMCommands(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_GET_PLDM_VERSION,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getPLDMVersion(request, payloadLength);
-        });
+                return this->getPLDMVersion(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_GET_TID,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getTID(request, payloadLength);
-        });
+                return this->getTID(request, payloadLength);
+            });
     }
 
     /** @brief Handler for getPLDMTypes
diff --git a/libpldmresponder/bios.cpp b/libpldmresponder/bios.cpp
index d97229d..1f3d536 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -35,11 +35,11 @@
     minutes = pldm::utils::decimalToBcd(time->tm_min);
     hours = pldm::utils::decimalToBcd(time->tm_hour);
     day = pldm::utils::decimalToBcd(time->tm_mday);
-    month = pldm::utils::decimalToBcd(time->tm_mon +
-                                      1); // The number of months in the range
-                                          // 0 to 11.PLDM expects range 1 to 12
-    year = pldm::utils::decimalToBcd(time->tm_year +
-                                     1900); // The number of years since 1900
+    month = pldm::utils::decimalToBcd(
+        time->tm_mon + 1);     // The number of months in the range
+                               // 0 to 11.PLDM expects range 1 to 12
+    year = pldm::utils::decimalToBcd(
+        time->tm_year + 1900); // The number of years since 1900
 }
 
 std::time_t timeToEpoch(uint8_t seconds, uint8_t minutes, uint8_t hours,
@@ -80,34 +80,34 @@
     handlers.emplace(
         PLDM_SET_DATE_TIME,
         [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-        return this->setDateTime(request, payloadLength);
-    });
+            return this->setDateTime(request, payloadLength);
+        });
     handlers.emplace(
         PLDM_GET_DATE_TIME,
         [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-        return this->getDateTime(request, payloadLength);
-    });
+            return this->getDateTime(request, payloadLength);
+        });
     handlers.emplace(
         PLDM_GET_BIOS_TABLE,
         [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-        return this->getBIOSTable(request, payloadLength);
-    });
+            return this->getBIOSTable(request, payloadLength);
+        });
     handlers.emplace(
         PLDM_SET_BIOS_TABLE,
         [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-        return this->setBIOSTable(request, payloadLength);
-    });
+            return this->setBIOSTable(request, payloadLength);
+        });
     handlers.emplace(
         PLDM_GET_BIOS_ATTRIBUTE_CURRENT_VALUE_BY_HANDLE,
         [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-        return this->getBIOSAttributeCurrentValueByHandle(request,
-                                                          payloadLength);
-    });
+            return this->getBIOSAttributeCurrentValueByHandle(request,
+                                                              payloadLength);
+        });
     handlers.emplace(
         PLDM_SET_BIOS_ATTRIBUTE_CURRENT_VALUE,
         [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-        return this->setBIOSAttributeCurrentValue(request, payloadLength);
-    });
+            return this->setBIOSAttributeCurrentValue(request, payloadLength);
+        });
 }
 
 Response Handler::getDateTime(const pldm_msg* request, size_t /*payloadLength*/)
diff --git a/libpldmresponder/bios_attribute.cpp b/libpldmresponder/bios_attribute.cpp
index 7ae6af7..d169b14 100644
--- a/libpldmresponder/bios_attribute.cpp
+++ b/libpldmresponder/bios_attribute.cpp
@@ -16,9 +16,9 @@
 
 BIOSAttribute::BIOSAttribute(const Json& entry,
                              DBusHandler* const dbusHandler) :
-    name(entry.at("attribute_name")),
-    readOnly(false), displayName(entry.at("display_name")),
-    helpText(entry.at("help_text")), dbusHandler(dbusHandler)
+    name(entry.at("attribute_name")), readOnly(false),
+    displayName(entry.at("display_name")), helpText(entry.at("help_text")),
+    dbusHandler(dbusHandler)
 {
     try
     {
diff --git a/libpldmresponder/bios_config.cpp b/libpldmresponder/bios_config.cpp
index 712555d..f58e7de 100644
--- a/libpldmresponder/bios_config.cpp
+++ b/libpldmresponder/bios_config.cpp
@@ -45,8 +45,7 @@
     pldm::requester::Handler<pldm::requester::Request>* handler,
     pldm::responder::platform_config::Handler* platformConfigHandler,
     pldm::responder::bios::Callback requestPLDMServiceName) :
-    jsonDir(jsonDir),
-    tableDir(tableDir), dbusHandler(dbusHandler), eid(eid),
+    jsonDir(jsonDir), tableDir(tableDir), dbusHandler(dbusHandler), eid(eid),
     instanceIdDb(instanceIdDb), handler(handler),
     platformConfigHandler(platformConfigHandler),
     requestPLDMServiceName(requestPLDMServiceName)
@@ -350,8 +349,8 @@
                     valueDisplayNames.insert(valueDisplayNames.end(),
                                              vdn.begin(), vdn.end());
                 }
-                auto getValue = [](uint16_t handle,
-                                   const Table& table) -> std::string {
+                auto getValue =
+                    [](uint16_t handle, const Table& table) -> std::string {
                     auto stringEntry = pldm_bios_table_string_find_by_handle(
                         table.data(), table.size(), handle);
 
@@ -414,8 +413,8 @@
                 // get default_value
                 for (size_t i = 0; i < defIndices.size(); i++)
                 {
-                    defaultValue = getValue(pvHandls[defIndices[i]],
-                                            *stringTable);
+                    defaultValue =
+                        getValue(pvHandls[defIndices[i]], *stringTable);
                 }
 
                 break;
@@ -518,8 +517,8 @@
     try
     {
         auto& bus = dbusHandler->getBus();
-        auto service = dbusHandler->getService(biosConfigPath,
-                                               biosConfigInterface);
+        auto service =
+            dbusHandler->getService(biosConfigPath, biosConfigInterface);
         auto method = bus.new_method_call(service.c_str(), biosConfigPath,
                                           dbusProperties, "Set");
         std::variant<BaseBIOSTable> value = baseBIOSTableMaps;
@@ -571,9 +570,9 @@
     {
         auto& bus = dbusHandler->getBus();
         auto service = dbusHandler->getService(biosObjPath, biosInterface);
-        auto method = bus.new_method_call(service.c_str(), biosObjPath,
-                                          "org.freedesktop.DBus.Properties",
-                                          "Get");
+        auto method =
+            bus.new_method_call(service.c_str(), biosObjPath,
+                                "org.freedesktop.DBus.Properties", "Get");
         method.append(biosInterface, "BaseBIOSTable");
         auto reply = bus.call(method, dbusTimeout);
         std::variant<BaseBIOSTable> varBiosTable{};
@@ -722,10 +721,9 @@
     return std::string(buffer.data(), buffer.data() + strLength);
 }
 
-std::string
-    BIOSConfig::displayStringHandle(uint16_t handle, uint8_t index,
-                                    const std::optional<Table>& attrTable,
-                                    const std::optional<Table>& stringTable)
+std::string BIOSConfig::displayStringHandle(
+    uint16_t handle, uint8_t index, const std::optional<Table>& attrTable,
+    const std::optional<Table>& stringTable)
 {
     auto attrEntry = pldm_bios_table_attr_find_by_handle(
         attrTable->data(), attrTable->size(), handle);
@@ -905,8 +903,8 @@
 
     auto attrValHeader = table::attribute_value::decodeHeader(attrValueEntry);
 
-    auto attrEntry = table::attribute::findByHandle(*attrTable,
-                                                    attrValHeader.attrHandle);
+    auto attrEntry =
+        table::attribute::findByHandle(*attrTable, attrValHeader.attrHandle);
     if (!attrEntry)
     {
         return PLDM_ERROR;
@@ -918,8 +916,8 @@
         return rc;
     }
 
-    auto destTable = table::attribute_value::updateTable(*attrValueTable, entry,
-                                                         size);
+    auto destTable =
+        table::attribute_value::updateTable(*attrValueTable, entry, size);
 
     if (!destTable)
     {
@@ -1095,8 +1093,8 @@
 
         auto iter = std::find_if(biosAttributes.begin(), biosAttributes.end(),
                                  [&attributeName](const auto& attr) {
-            return attr->name == attributeName;
-        });
+                                     return attr->name == attributeName;
+                                 });
 
         if (iter == biosAttributes.end())
         {
@@ -1161,26 +1159,26 @@
         pldm::utils::DBusHandler::getBus(),
         propertiesChanged(objPath, objInterface),
         [this](sdbusplus::message_t& msg) {
-        constexpr auto propertyName = "PendingAttributes";
+            constexpr auto propertyName = "PendingAttributes";
 
-        using Value =
-            std::variant<std::string, PendingAttributes, BaseBIOSTable>;
-        using Properties = std::map<DbusProp, Value>;
+            using Value =
+                std::variant<std::string, PendingAttributes, BaseBIOSTable>;
+            using Properties = std::map<DbusProp, Value>;
 
-        Properties props{};
-        std::string intf;
-        msg.read(intf, props);
+            Properties props{};
+            std::string intf;
+            msg.read(intf, props);
 
-        auto valPropMap = props.find(propertyName);
-        if (valPropMap == props.end())
-        {
-            return;
-        }
+            auto valPropMap = props.find(propertyName);
+            if (valPropMap == props.end())
+            {
+                return;
+            }
 
-        PendingAttributes pendingAttributes =
-            std::get<PendingAttributes>(valPropMap->second);
-        this->constructPendingAttribute(pendingAttributes);
-    });
+            PendingAttributes pendingAttributes =
+                std::get<PendingAttributes>(valPropMap->second);
+            this->constructPendingAttribute(pendingAttributes);
+        });
 
     biosAttrMatch.emplace_back(std::move(updateBIOSMatch));
 }
diff --git a/libpldmresponder/bios_config.hpp b/libpldmresponder/bios_config.hpp
index 5812e3b..05f960d 100644
--- a/libpldmresponder/bios_config.hpp
+++ b/libpldmresponder/bios_config.hpp
@@ -232,11 +232,12 @@
                         propertiesChanged(dBusMap->objectPath,
                                           dBusMap->interface),
                         [this, biosAttrIndex](sdbusplus::message_t& msg) {
-                    DbusChObjProperties props;
-                    std::string iface;
-                    msg.read(iface, props);
-                    processBiosAttrChangeNotification(props, biosAttrIndex);
-                }));
+                            DbusChObjProperties props;
+                            std::string iface;
+                            msg.read(iface, props);
+                            processBiosAttrChangeNotification(props,
+                                                              biosAttrIndex);
+                        }));
 
                 biosAttrMatch.push_back(
                     std::make_unique<sdbusplus::bus::match_t>(
@@ -244,17 +245,17 @@
                         interfacesAdded() + argNpath(0, dBusMap->objectPath),
                         [this, biosAttrIndex, interface = dBusMap->interface](
                             sdbusplus::message_t& msg) {
-                    sdbusplus::message::object_path path;
-                    DbusIfacesAdded interfaces;
+                            sdbusplus::message::object_path path;
+                            DbusIfacesAdded interfaces;
 
-                    msg.read(path, interfaces);
-                    auto ifaceIt = interfaces.find(interface);
-                    if (ifaceIt != interfaces.end())
-                    {
-                        processBiosAttrChangeNotification(ifaceIt->second,
-                                                          biosAttrIndex);
-                    }
-                }));
+                            msg.read(path, interfaces);
+                            auto ifaceIt = interfaces.find(interface);
+                            if (ifaceIt != interfaces.end())
+                            {
+                                processBiosAttrChangeNotification(
+                                    ifaceIt->second, biosAttrIndex);
+                            }
+                        }));
             }
         }
         catch (const std::exception& e)
diff --git a/libpldmresponder/bios_enum_attribute.cpp b/libpldmresponder/bios_enum_attribute.cpp
index 5d436c1..2434c79 100644
--- a/libpldmresponder/bios_enum_attribute.cpp
+++ b/libpldmresponder/bios_enum_attribute.cpp
@@ -49,8 +49,9 @@
 uint8_t BIOSEnumAttribute::getValueIndex(const std::string& value,
                                          const std::vector<std::string>& pVs)
 {
-    auto iter = std::find_if(pVs.begin(), pVs.end(),
-                             [&value](const auto& v) { return v == value; });
+    auto iter = std::find_if(pVs.begin(), pVs.end(), [&value](const auto& v) {
+        return v == value;
+    });
     if (iter == pVs.end())
     {
         throw std::invalid_argument("value must be one of possible value");
@@ -183,8 +184,8 @@
 
     auto it = std::find_if(valMap.begin(), valMap.end(),
                            [&valueString](const auto& typePair) {
-        return typePair.second == valueString;
-    });
+                               return typePair.second == valueString;
+                           });
     if (it == valMap.end())
     {
         return;
@@ -205,8 +206,8 @@
     const BIOSStringTable& stringTable, Table& attrTable, Table& attrValueTable,
     std::optional<std::variant<int64_t, std::string>> optAttributeValue)
 {
-    auto possibleValuesHandle = getPossibleValuesHandle(stringTable,
-                                                        possibleValues);
+    auto possibleValuesHandle =
+        getPossibleValuesHandle(stringTable, possibleValues);
     std::vector<uint8_t> defaultIndices(1, 0);
     defaultIndices[0] = getValueIndex(defaultValue, possibleValues);
 
@@ -215,8 +216,8 @@
         (uint8_t)possibleValuesHandle.size(), possibleValuesHandle.data(),
         (uint8_t)defaultIndices.size(),       defaultIndices.data()};
 
-    auto attrTableEntry = table::attribute::constructEnumEntry(attrTable,
-                                                               &info);
+    auto attrTableEntry =
+        table::attribute::constructEnumEntry(attrTable, &info);
     auto [attrHandle, attrType,
           _] = table::attribute::decodeHeader(attrTableEntry);
 
diff --git a/libpldmresponder/bios_integer_attribute.cpp b/libpldmresponder/bios_integer_attribute.cpp
index 058df1b..fd578a6 100644
--- a/libpldmresponder/bios_integer_attribute.cpp
+++ b/libpldmresponder/bios_integer_attribute.cpp
@@ -112,8 +112,8 @@
         integerInfo.scalarIncrement,  integerInfo.defaultValue,
     };
 
-    auto attrTableEntry = table::attribute::constructIntegerEntry(attrTable,
-                                                                  &info);
+    auto attrTableEntry =
+        table::attribute::constructIntegerEntry(attrTable, &info);
 
     auto [attrHandle, attrType,
           _] = table::attribute::decodeHeader(attrTableEntry);
@@ -223,8 +223,8 @@
     const std::variant<int64_t, std::string>& attributevalue,
     Table& attrValueEntry)
 {
-    attrValueEntry.resize(sizeof(pldm_bios_attr_val_table_entry) +
-                          sizeof(int64_t) - 1);
+    attrValueEntry.resize(
+        sizeof(pldm_bios_attr_val_table_entry) + sizeof(int64_t) - 1);
 
     auto entry = reinterpret_cast<pldm_bios_attr_val_table_entry*>(
         attrValueEntry.data());
diff --git a/libpldmresponder/bios_string_attribute.cpp b/libpldmresponder/bios_string_attribute.cpp
index d55c99a..4b4bf3d 100644
--- a/libpldmresponder/bios_string_attribute.cpp
+++ b/libpldmresponder/bios_string_attribute.cpp
@@ -108,8 +108,8 @@
         stringInfo.defString.data(),
     };
 
-    auto attrTableEntry = table::attribute::constructStringEntry(attrTable,
-                                                                 &info);
+    auto attrTableEntry =
+        table::attribute::constructStringEntry(attrTable, &info);
     auto [attrHandle, attrType,
           _] = table::attribute::decodeHeader(attrTableEntry);
 
@@ -160,8 +160,8 @@
     std::string value = std::get<std::string>(attributevalue);
     uint16_t len = value.size();
 
-    attrValueEntry.resize(sizeof(pldm_bios_attr_val_table_entry) +
-                          sizeof(uint16_t) + len - 1);
+    attrValueEntry.resize(
+        sizeof(pldm_bios_attr_val_table_entry) + sizeof(uint16_t) + len - 1);
 
     auto entry = reinterpret_cast<pldm_bios_attr_val_table_entry*>(
         attrValueEntry.data());
diff --git a/libpldmresponder/bios_table.cpp b/libpldmresponder/bios_table.cpp
index d7e3e39..17bb79b 100644
--- a/libpldmresponder/bios_table.cpp
+++ b/libpldmresponder/bios_table.cpp
@@ -106,8 +106,8 @@
                                                buffer.size());
     return std::string(buffer.data(), buffer.data() + strLength);
 }
-const pldm_bios_string_table_entry* constructEntry(Table& table,
-                                                   const std::string& str)
+const pldm_bios_string_table_entry*
+    constructEntry(Table& table, const std::string& str)
 {
     auto tableSize = table.size();
     auto entryLength = pldm_bios_table_string_entry_encode_length(str.length());
@@ -115,8 +115,8 @@
     // Preconditions are upheld therefore no error check necessary
     pldm_bios_table_string_entry_encode(table.data() + tableSize, entryLength,
                                         str.c_str(), str.length());
-    return reinterpret_cast<pldm_bios_string_table_entry*>(table.data() +
-                                                           tableSize);
+    return reinterpret_cast<pldm_bios_string_table_entry*>(
+        table.data() + tableSize);
 }
 
 } // namespace string
@@ -131,23 +131,22 @@
     return {attrHandle, attrType, stringHandle};
 }
 
-const pldm_bios_attr_table_entry* findByHandle(const Table& table,
-                                               uint16_t handle)
+const pldm_bios_attr_table_entry*
+    findByHandle(const Table& table, uint16_t handle)
 {
     return pldm_bios_table_attr_find_by_handle(table.data(), table.size(),
                                                handle);
 }
 
-const pldm_bios_attr_table_entry* findByStringHandle(const Table& table,
-                                                     uint16_t handle)
+const pldm_bios_attr_table_entry*
+    findByStringHandle(const Table& table, uint16_t handle)
 {
     return pldm_bios_table_attr_find_by_string_handle(table.data(),
                                                       table.size(), handle);
 }
 
-const pldm_bios_attr_table_entry*
-    constructStringEntry(Table& table,
-                         pldm_bios_table_attr_entry_string_info* info)
+const pldm_bios_attr_table_entry* constructStringEntry(
+    Table& table, pldm_bios_table_attr_entry_string_info* info)
 {
     auto entryLength =
         pldm_bios_table_attr_entry_string_encode_length(info->def_length);
@@ -162,13 +161,12 @@
               "RC", rc);
         throw std::runtime_error("Failed to encode BIOS table string entry");
     }
-    return reinterpret_cast<pldm_bios_attr_table_entry*>(table.data() +
-                                                         tableSize);
+    return reinterpret_cast<pldm_bios_attr_table_entry*>(
+        table.data() + tableSize);
 }
 
-const pldm_bios_attr_table_entry*
-    constructIntegerEntry(Table& table,
-                          pldm_bios_table_attr_entry_integer_info* info)
+const pldm_bios_attr_table_entry* constructIntegerEntry(
+    Table& table, pldm_bios_table_attr_entry_integer_info* info)
 {
     auto entryLength = pldm_bios_table_attr_entry_integer_encode_length();
     auto tableSize = table.size();
@@ -183,8 +181,8 @@
         throw std::runtime_error(
             "Failed to encode BIOS attribute table integer entry");
     }
-    return reinterpret_cast<pldm_bios_attr_table_entry*>(table.data() +
-                                                         tableSize);
+    return reinterpret_cast<pldm_bios_attr_table_entry*>(
+        table.data() + tableSize);
 }
 
 StringField decodeStringEntry(const pldm_bios_attr_table_entry* entry)
@@ -233,8 +231,8 @@
     pldm_bios_table_attr_entry_enum_encode(table.data() + tableSize,
                                            entryLength, info);
 
-    return reinterpret_cast<pldm_bios_attr_table_entry*>(table.data() +
-                                                         tableSize);
+    return reinterpret_cast<pldm_bios_attr_table_entry*>(
+        table.data() + tableSize);
 }
 
 EnumField decodeEnumEntry(const pldm_bios_attr_table_entry* entry)
@@ -276,8 +274,8 @@
 std::string decodeStringEntry(const pldm_bios_attr_val_table_entry* entry)
 {
     variable_field currentString{};
-    pldm_bios_table_attr_value_entry_string_decode_string(entry,
-                                                          &currentString);
+    pldm_bios_table_attr_value_entry_string_decode_string(
+        entry, &currentString);
     return std::string(currentString.ptr,
                        currentString.ptr + currentString.length);
 }
@@ -297,9 +295,8 @@
     return currHdls;
 }
 
-const pldm_bios_attr_val_table_entry*
-    constructStringEntry(Table& table, uint16_t attrHandle, uint8_t attrType,
-                         const std::string& str)
+const pldm_bios_attr_val_table_entry* constructStringEntry(
+    Table& table, uint16_t attrHandle, uint8_t attrType, const std::string& str)
 {
     auto strLen = str.size();
     auto entryLength =
@@ -317,14 +314,12 @@
         throw std::runtime_error(
             "Failed to encode BIOS attribute table string entry");
     }
-    return reinterpret_cast<pldm_bios_attr_val_table_entry*>(table.data() +
-                                                             tableSize);
+    return reinterpret_cast<pldm_bios_attr_val_table_entry*>(
+        table.data() + tableSize);
 }
 
-const pldm_bios_attr_val_table_entry* constructIntegerEntry(Table& table,
-                                                            uint16_t attrHandle,
-                                                            uint8_t attrType,
-                                                            uint64_t value)
+const pldm_bios_attr_val_table_entry* constructIntegerEntry(
+    Table& table, uint16_t attrHandle, uint8_t attrType, uint64_t value)
 {
     auto entryLength = pldm_bios_table_attr_value_entry_encode_integer_length();
 
@@ -340,8 +335,8 @@
         throw std::runtime_error(
             "Failed to encode BIOS attribute table integery entry");
     }
-    return reinterpret_cast<pldm_bios_attr_val_table_entry*>(table.data() +
-                                                             tableSize);
+    return reinterpret_cast<pldm_bios_attr_val_table_entry*>(
+        table.data() + tableSize);
 }
 
 const pldm_bios_attr_val_table_entry*
@@ -363,8 +358,8 @@
         throw std::runtime_error(
             "Failed to encode BIOS attribute table enum entry");
     }
-    return reinterpret_cast<pldm_bios_attr_val_table_entry*>(table.data() +
-                                                             tableSize);
+    return reinterpret_cast<pldm_bios_attr_val_table_entry*>(
+        table.data() + tableSize);
 }
 
 std::optional<Table> updateTable(const Table& table, const void* entry,
diff --git a/libpldmresponder/bios_table.hpp b/libpldmresponder/bios_table.hpp
index 5959c7c..8b5f8bc 100644
--- a/libpldmresponder/bios_table.hpp
+++ b/libpldmresponder/bios_table.hpp
@@ -164,8 +164,8 @@
  *  @param[in] str - string itself
  *  @return pointer to the constructed entry
  */
-const pldm_bios_string_table_entry* constructEntry(Table& table,
-                                                   const std::string& str);
+const pldm_bios_string_table_entry*
+    constructEntry(Table& table, const std::string& str);
 
 } // namespace string
 
@@ -193,16 +193,16 @@
  *  @param[in] handle - attribute handle
  *  @return Pointer to the attribute table entry
  */
-const pldm_bios_attr_table_entry* findByHandle(const Table& table,
-                                               uint16_t handle);
+const pldm_bios_attr_table_entry*
+    findByHandle(const Table& table, uint16_t handle);
 
 /** @brief Find attribute entry by string handle
  *  @param[in] table - attribute table
  *  @param[in] handle - string handle
  *  @return Pointer to the attribute table entry
  */
-const pldm_bios_attr_table_entry* findByStringHandle(const Table& table,
-                                                     uint16_t handle);
+const pldm_bios_attr_table_entry*
+    findByStringHandle(const Table& table, uint16_t handle);
 
 /** @struct StringField
  *  @brief String field of attribute table
@@ -228,9 +228,8 @@
  *  @param[in] info - string info
  *  @return pointer to the constructed entry
  */
-const pldm_bios_attr_table_entry*
-    constructStringEntry(Table& table,
-                         pldm_bios_table_attr_entry_string_info* info);
+const pldm_bios_attr_table_entry* constructStringEntry(
+    Table& table, pldm_bios_table_attr_entry_string_info* info);
 
 /** @struct IntegerField
  *  @brief Integer field of attribute table
@@ -249,9 +248,8 @@
  *  @param[in] info - integer info
  *  @return pointer to the constructed entry
  */
-const pldm_bios_attr_table_entry*
-    constructIntegerEntry(Table& table,
-                          pldm_bios_table_attr_entry_integer_info* info);
+const pldm_bios_attr_table_entry* constructIntegerEntry(
+    Table& table, pldm_bios_table_attr_entry_integer_info* info);
 
 /** @brief decode integer entry of attribute table
  *  @param[in] entry - Pointer to an attribute table entry
@@ -280,9 +278,8 @@
  *  @param[in] info - enum info
  *  @return pointer to the constructed entry
  */
-const pldm_bios_attr_table_entry*
-    constructEnumEntry(Table& table,
-                       pldm_bios_table_attr_entry_enum_info* info);
+const pldm_bios_attr_table_entry* constructEnumEntry(
+    Table& table, pldm_bios_table_attr_entry_enum_info* info);
 
 } // namespace attribute
 
@@ -343,10 +340,8 @@
  *  @param[in] value - The integer
  *  @return Pointer to the constructed entry
  */
-const pldm_bios_attr_val_table_entry* constructIntegerEntry(Table& table,
-                                                            uint16_t attrHandle,
-                                                            uint8_t attrType,
-                                                            uint64_t value);
+const pldm_bios_attr_val_table_entry* constructIntegerEntry(
+    Table& table, uint16_t attrHandle, uint8_t attrType, uint64_t value);
 
 /** @brief Construct enum entry of attribute value table at the end of
  *         the given table
diff --git a/libpldmresponder/fru.cpp b/libpldmresponder/fru.cpp
index a126a62..5a7368e 100644
--- a/libpldmresponder/fru.cpp
+++ b/libpldmresponder/fru.cpp
@@ -105,8 +105,8 @@
                     pldm_entity node = pldm_entity_extract(it.second);
                     if (node.entity_type == entity.entity_type)
                     {
-                        entity.entity_instance_num = node.entity_instance_num +
-                                                     1;
+                        entity.entity_instance_num =
+                            node.entity_instance_num + 1;
                         break;
                     }
                 }
@@ -230,9 +230,9 @@
     std::string currentBmcVersion;
     try
     {
-        auto method = bus.new_method_call(pldm::utils::mapperService,
-                                          fwFunctionalObjPath,
-                                          pldm::utils::dbusProperties, "Get");
+        auto method =
+            bus.new_method_call(pldm::utils::mapperService, fwFunctionalObjPath,
+                                pldm::utils::dbusProperties, "Get");
         method.append("xyz.openbmc_project.Association", "endpoints");
         std::variant<std::vector<std::string>> paths;
         auto reply = bus.call(method, dbusTimeout);
@@ -385,10 +385,9 @@
     }
 }
 
-int FruImpl::getFRURecordByOption(std::vector<uint8_t>& fruData,
-                                  uint16_t /* fruTableHandle */,
-                                  uint16_t recordSetIdentifer,
-                                  uint8_t recordType, uint8_t fieldType)
+int FruImpl::getFRURecordByOption(
+    std::vector<uint8_t>& fruData, uint16_t /* fruTableHandle */,
+    uint16_t recordSetIdentifer, uint8_t recordType, uint8_t fieldType)
 {
     using sum = uint32_t;
 
@@ -487,9 +486,9 @@
         sizeof(pldm_msg_hdr) + PLDM_GET_FRU_RECORD_TABLE_MIN_RESP_BYTES, 0);
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
 
-    auto rc = encode_get_fru_record_table_resp(request->hdr.instance_id,
-                                               PLDM_SUCCESS, 0,
-                                               PLDM_START_AND_END, responsePtr);
+    auto rc =
+        encode_get_fru_record_table_resp(request->hdr.instance_id, PLDM_SUCCESS,
+                                         0, PLDM_START_AND_END, responsePtr);
     if (rc != PLDM_SUCCESS)
     {
         return ccOnlyResponse(request, rc);
@@ -534,8 +533,8 @@
         return ccOnlyResponse(request, rc);
     }
 
-    auto respPayloadLength = PLDM_GET_FRU_RECORD_BY_OPTION_MIN_RESP_BYTES +
-                             fruData.size();
+    auto respPayloadLength =
+        PLDM_GET_FRU_RECORD_BY_OPTION_MIN_RESP_BYTES + fruData.size();
     Response response(sizeof(pldm_msg_hdr) + respPayloadLength, 0);
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
 
@@ -573,8 +572,8 @@
         return ccOnlyResponse(request, rc);
     }
 
-    Response response(sizeof(pldm_msg_hdr) +
-                      PLDM_SET_FRU_RECORD_TABLE_RESP_BYTES);
+    Response response(
+        sizeof(pldm_msg_hdr) + PLDM_SET_FRU_RECORD_TABLE_RESP_BYTES);
     struct pldm_msg* responsePtr = reinterpret_cast<pldm_msg*>(response.data());
 
     rc = encode_set_fru_record_table_resp(
diff --git a/libpldmresponder/fru.hpp b/libpldmresponder/fru.hpp
index a0757e6..af55f92 100644
--- a/libpldmresponder/fru.hpp
+++ b/libpldmresponder/fru.hpp
@@ -67,8 +67,8 @@
             const std::filesystem::path& fruMasterJsonPath, pldm_pdr* pdrRepo,
             pldm_entity_association_tree* entityTree,
             pldm_entity_association_tree* bmcEntityTree) :
-        parser(configPath, fruMasterJsonPath),
-        pdrRepo(pdrRepo), entityTree(entityTree), bmcEntityTree(bmcEntityTree)
+        parser(configPath, fruMasterJsonPath), pdrRepo(pdrRepo),
+        entityTree(entityTree), bmcEntityTree(bmcEntityTree)
     {}
 
     /** @brief Total length of the FRU table in bytes, this includes the pad
@@ -268,23 +268,23 @@
         handlers.emplace(
             PLDM_GET_FRU_RECORD_TABLE_METADATA,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getFRURecordTableMetadata(request, payloadLength);
-        });
+                return this->getFRURecordTableMetadata(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_GET_FRU_RECORD_TABLE,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getFRURecordTable(request, payloadLength);
-        });
+                return this->getFRURecordTable(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_GET_FRU_RECORD_BY_OPTION,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getFRURecordByOption(request, payloadLength);
-        });
+                return this->getFRURecordByOption(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_SET_FRU_RECORD_TABLE,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->setFRURecordTable(request, payloadLength);
-        });
+                return this->setFRURecordTable(request, payloadLength);
+            });
     }
 
     /** @brief Handler for Get FRURecordTableMetadata
diff --git a/libpldmresponder/fru_parser.cpp b/libpldmresponder/fru_parser.cpp
index c5ea3ea..bc04f56 100644
--- a/libpldmresponder/fru_parser.cpp
+++ b/libpldmresponder/fru_parser.cpp
@@ -147,8 +147,8 @@
             }
 
             FruRecordInfo fruInfo;
-            fruInfo = std::make_tuple(recordType, encType,
-                                      std::move(fieldInfo));
+            fruInfo =
+                std::make_tuple(recordType, encType, std::move(fieldInfo));
 
             auto search = recordMap.find(dbusIntfName);
 
diff --git a/libpldmresponder/pdr.cpp b/libpldmresponder/pdr.cpp
index aa05303..9a149f7 100644
--- a/libpldmresponder/pdr.cpp
+++ b/libpldmresponder/pdr.cpp
@@ -33,14 +33,13 @@
     }
 }
 
-const pldm_pdr_record* getRecordByHandle(const RepoInterface& pdrRepo,
-                                         RecordHandle recordHandle,
-                                         PdrEntry& pdrEntry)
+const pldm_pdr_record* getRecordByHandle(
+    const RepoInterface& pdrRepo, RecordHandle recordHandle, PdrEntry& pdrEntry)
 {
     uint8_t* pdrData = nullptr;
-    auto record = pldm_pdr_find_record(pdrRepo.getPdr(), recordHandle, &pdrData,
-                                       &pdrEntry.size,
-                                       &pdrEntry.handle.nextRecordHandle);
+    auto record =
+        pldm_pdr_find_record(pdrRepo.getPdr(), recordHandle, &pdrData,
+                             &pdrEntry.size, &pdrEntry.handle.nextRecordHandle);
     if (record)
     {
         pdrEntry.data = pdrData;
diff --git a/libpldmresponder/pdr_numeric_effecter.hpp b/libpldmresponder/pdr_numeric_effecter.hpp
index a425da3..362b10d 100644
--- a/libpldmresponder/pdr_numeric_effecter.hpp
+++ b/libpldmresponder/pdr_numeric_effecter.hpp
@@ -48,8 +48,8 @@
         pdr->hdr.version = 1;
         pdr->hdr.type = PLDM_NUMERIC_EFFECTER_PDR;
         pdr->hdr.record_change_num = 0;
-        pdr->hdr.length = sizeof(pldm_numeric_effecter_value_pdr) -
-                          sizeof(pldm_pdr_hdr);
+        pdr->hdr.length =
+            sizeof(pldm_numeric_effecter_value_pdr) - sizeof(pldm_pdr_hdr);
 
         pdr->terminus_handle = e.value("terminus_handle", 0);
 
@@ -99,15 +99,15 @@
         pdr->aux_oem_unit_handle = e.value("aux_oem_unit_handle", 0);
         pdr->aux_rate_unit = e.value("aux_rate_unit", 0);
         pdr->is_linear = e.value("is_linear", true);
-        pdr->effecter_data_size = e.value("effecter_data_size",
-                                          PLDM_EFFECTER_DATA_SIZE_UINT8);
+        pdr->effecter_data_size =
+            e.value("effecter_data_size", PLDM_EFFECTER_DATA_SIZE_UINT8);
         pdr->resolution = e.value("effecter_resolution_init", 1.00);
         pdr->offset = e.value("offset", 0.00);
         pdr->accuracy = e.value("accuracy", 0);
         pdr->plus_tolerance = e.value("plus_tolerance", 0);
         pdr->minus_tolerance = e.value("minus_tolerance", 0);
-        pdr->state_transition_interval = e.value("state_transition_interval",
-                                                 0.00);
+        pdr->state_transition_interval =
+            e.value("state_transition_interval", 0.00);
         pdr->transition_interval = e.value("transition_interval", 0.00);
         switch (pdr->effecter_data_size)
         {
@@ -139,8 +139,8 @@
                 break;
         }
 
-        pdr->range_field_format = e.value("range_field_format",
-                                          PLDM_RANGE_FIELD_FORMAT_UINT8);
+        pdr->range_field_format =
+            e.value("range_field_format", PLDM_RANGE_FIELD_FORMAT_UINT8);
         pdr->range_field_support.byte = e.value("range_field_support", 0);
         switch (pdr->range_field_format)
         {
@@ -208,8 +208,8 @@
         pldm::utils::DBusMapping dbusMapping{};
         try
         {
-            auto service = dBusIntf.getService(objectPath.c_str(),
-                                               interface.c_str());
+            auto service =
+                dBusIntf.getService(objectPath.c_str(), interface.c_str());
 
             dbusMapping = pldm::utils::DBusMapping{objectPath, interface,
                                                    propertyName, propertyType};
diff --git a/libpldmresponder/pdr_state_effecter.hpp b/libpldmresponder/pdr_state_effecter.hpp
index 42af4ad..d431b0b 100644
--- a/libpldmresponder/pdr_state_effecter.hpp
+++ b/libpldmresponder/pdr_state_effecter.hpp
@@ -111,8 +111,8 @@
 
         pldm::responder::pdr_utils::DbusMappings dbusMappings{};
         pldm::responder::pdr_utils::DbusValMaps dbusValMaps{};
-        uint8_t* start = entry.data() + sizeof(pldm_state_effecter_pdr) -
-                         sizeof(uint8_t);
+        uint8_t* start =
+            entry.data() + sizeof(pldm_state_effecter_pdr) - sizeof(uint8_t);
         for (const auto& effecter : effecters)
         {
             auto set = effecter.value("set", empty);
@@ -146,8 +146,8 @@
             pldm::utils::DBusMapping dbusMapping{};
             try
             {
-                auto service = dBusIntf.getService(objectPath.c_str(),
-                                                   interface.c_str());
+                auto service =
+                    dBusIntf.getService(objectPath.c_str(), interface.c_str());
 
                 dbusMapping = pldm::utils::DBusMapping{
                     objectPath, interface, propertyName, propertyType};
diff --git a/libpldmresponder/pdr_state_sensor.hpp b/libpldmresponder/pdr_state_sensor.hpp
index 58236da..03bac20 100644
--- a/libpldmresponder/pdr_state_sensor.hpp
+++ b/libpldmresponder/pdr_state_sensor.hpp
@@ -122,8 +122,8 @@
 
         pldm::responder::pdr_utils::DbusMappings dbusMappings{};
         pldm::responder::pdr_utils::DbusValMaps dbusValMaps{};
-        uint8_t* start = entry.data() + sizeof(pldm_state_sensor_pdr) -
-                         sizeof(uint8_t);
+        uint8_t* start =
+            entry.data() + sizeof(pldm_state_sensor_pdr) - sizeof(uint8_t);
         for (const auto& sensor : sensors)
         {
             auto set = sensor.value("set", empty);
@@ -157,8 +157,8 @@
             pldm::utils::DBusMapping dbusMapping{};
             try
             {
-                auto service = dBusIntf.getService(objectPath.c_str(),
-                                                   interface.c_str());
+                auto service =
+                    dBusIntf.getService(objectPath.c_str(), interface.c_str());
 
                 dbusMapping = pldm::utils::DBusMapping{
                     objectPath, interface, propertyName, propertyType};
diff --git a/libpldmresponder/pdr_utils.cpp b/libpldmresponder/pdr_utils.cpp
index c15e282..7d87c67 100644
--- a/libpldmresponder/pdr_utils.cpp
+++ b/libpldmresponder/pdr_utils.cpp
@@ -48,9 +48,9 @@
 {
     constexpr uint32_t firstNum = 0;
     uint8_t* pdrData = nullptr;
-    auto record = pldm_pdr_find_record(getPdr(), firstNum, &pdrData,
-                                       &pdrEntry.size,
-                                       &pdrEntry.handle.nextRecordHandle);
+    auto record =
+        pldm_pdr_find_record(getPdr(), firstNum, &pdrData, &pdrEntry.size,
+                             &pdrEntry.handle.nextRecordHandle);
     if (record)
     {
         pdrEntry.data = pdrData;
@@ -63,9 +63,9 @@
                                            PdrEntry& pdrEntry)
 {
     uint8_t* pdrData = nullptr;
-    auto record = pldm_pdr_get_next_record(getPdr(), currRecord, &pdrData,
-                                           &pdrEntry.size,
-                                           &pdrEntry.handle.nextRecordHandle);
+    auto record =
+        pldm_pdr_get_next_record(getPdr(), currRecord, &pdrData, &pdrEntry.size,
+                                 &pdrEntry.handle.nextRecordHandle);
     if (record)
     {
         pdrEntry.data = pdrData;
@@ -209,8 +209,8 @@
                            std::move(sensorInfo));
 }
 
-std::vector<FruRecordDataFormat> parseFruRecordTable(const uint8_t* fruData,
-                                                     size_t fruLen)
+std::vector<FruRecordDataFormat>
+    parseFruRecordTable(const uint8_t* fruData, size_t fruLen)
 {
     // Refer: DSP0257_1.0.0 Table 2
     // 7: uint16_t(FRU Record Set Identifier), uint8_t(FRU Record Type),
@@ -239,23 +239,24 @@
 
         index += 5;
 
-        std::ranges::for_each(std::views::iota(0, (int)record->num_fru_fields),
-                              [fruData, &fru, &index](int) {
-            auto tlv =
-                reinterpret_cast<const pldm_fru_record_tlv*>(fruData + index);
-            FruTLV frutlv;
-            frutlv.fruFieldType = tlv->type;
-            frutlv.fruFieldLen = tlv->length;
-            frutlv.fruFieldValue.resize(tlv->length);
-            for (const auto& i : std::views::iota(0, (int)tlv->length))
-            {
-                memcpy(frutlv.fruFieldValue.data() + i, tlv->value + i, 1);
-            }
-            fru.fruTLV.push_back(frutlv);
+        std::ranges::for_each(
+            std::views::iota(0, (int)record->num_fru_fields),
+            [fruData, &fru, &index](int) {
+                auto tlv = reinterpret_cast<const pldm_fru_record_tlv*>(
+                    fruData + index);
+                FruTLV frutlv;
+                frutlv.fruFieldType = tlv->type;
+                frutlv.fruFieldLen = tlv->length;
+                frutlv.fruFieldValue.resize(tlv->length);
+                for (const auto& i : std::views::iota(0, (int)tlv->length))
+                {
+                    memcpy(frutlv.fruFieldValue.data() + i, tlv->value + i, 1);
+                }
+                fru.fruTLV.push_back(frutlv);
 
-            // 2: 1byte FRU Field Type, 1byte FRU Field Length
-            index += fruFieldTypeLength + (unsigned)tlv->length;
-        });
+                // 2: 1byte FRU Field Type, 1byte FRU Field Length
+                index += fruFieldTypeLength + (unsigned)tlv->length;
+            });
 
         frus.push_back(fru);
     }
diff --git a/libpldmresponder/pdr_utils.hpp b/libpldmresponder/pdr_utils.hpp
index 01fe223..a5374aa 100644
--- a/libpldmresponder/pdr_utils.hpp
+++ b/libpldmresponder/pdr_utils.hpp
@@ -161,9 +161,8 @@
      *  @return opaque pointer acting as PDR record handle, will be NULL if
      *          record was not found
      */
-    virtual const pldm_pdr_record*
-        getNextRecord(const pldm_pdr_record* currRecord,
-                      PdrEntry& pdrEntry) = 0;
+    virtual const pldm_pdr_record* getNextRecord(
+        const pldm_pdr_record* currRecord, PdrEntry& pdrEntry) = 0;
 
     /** @brief Get record handle of a PDR record
      *
@@ -239,8 +238,8 @@
  *  @return std::vector<FruRecordDataFormat> - the vector of the FRU record data
  *          format structure
  */
-std::vector<FruRecordDataFormat> parseFruRecordTable(const uint8_t* fruData,
-                                                     size_t fruLen);
+std::vector<FruRecordDataFormat>
+    parseFruRecordTable(const uint8_t* fruData, size_t fruLen);
 
 /** @brief Return the size of data type based on the effecterDataSize enum value
  *
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 1e0955a..522899c 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -87,22 +87,23 @@
         {PLDM_STATE_EFFECTER_PDR,
          [this](const DBusHandler& dBusIntf, const auto& json,
                 RepoInterface& repo) {
-        pdr_state_effecter::generateStateEffecterPDR<pldm::utils::DBusHandler,
-                                                     Handler>(dBusIntf, json,
-                                                              *this, repo);
-    }},
+             pdr_state_effecter::generateStateEffecterPDR<
+                 pldm::utils::DBusHandler, Handler>(dBusIntf, json, *this,
+                                                    repo);
+         }},
         {PLDM_NUMERIC_EFFECTER_PDR,
          [this](const DBusHandler& dBusIntf, const auto& json,
                 RepoInterface& repo) {
-        pdr_numeric_effecter::generateNumericEffecterPDR<
-            pldm::utils::DBusHandler, Handler>(dBusIntf, json, *this, repo);
-    }},
+             pdr_numeric_effecter::generateNumericEffecterPDR<
+                 pldm::utils::DBusHandler, Handler>(dBusIntf, json, *this,
+                                                    repo);
+         }},
         {PLDM_STATE_SENSOR_PDR, [this](const DBusHandler& dBusIntf,
                                        const auto& json, RepoInterface& repo) {
-        pdr_state_sensor::generateStateSensorPDR<pldm::utils::DBusHandler,
-                                                 Handler>(dBusIntf, json, *this,
-                                                          repo);
-    }}};
+             pdr_state_sensor::generateStateSensorPDR<pldm::utils::DBusHandler,
+                                                      Handler>(dBusIntf, json,
+                                                               *this, repo);
+         }}};
 
     Type pdrType{};
     for (const auto& directory : dir)
@@ -120,16 +121,16 @@
                         for (const auto& effecter : effecterPDRs)
                         {
                             pdrType = effecter.value("pdrType", 0);
-                            generateHandlers.at(pdrType)(dBusIntf, effecter,
-                                                         repo);
+                            generateHandlers.at(
+                                pdrType)(dBusIntf, effecter, repo);
                         }
 
                         auto sensorPDRs = json.value("sensorPDRs", empty);
                         for (const auto& sensor : sensorPDRs)
                         {
                             pdrType = sensor.value("pdrType", 0);
-                            generateHandlers.at(pdrType)(dBusIntf, sensor,
-                                                         repo);
+                            generateHandlers.at(
+                                pdrType)(dBusIntf, sensor, repo);
                         }
                     }
                 }
@@ -296,9 +297,9 @@
         return CmdHandler::ccOnlyResponse(request, PLDM_ERROR_INVALID_LENGTH);
     }
 
-    int rc = decode_set_state_effecter_states_req(request, payloadLength,
-                                                  &effecterId, &compEffecterCnt,
-                                                  stateField.data());
+    int rc = decode_set_state_effecter_states_req(
+        request, payloadLength, &effecterId, &compEffecterCnt,
+        stateField.data());
 
     if (rc != PLDM_SUCCESS)
     {
@@ -378,8 +379,8 @@
             const auto& handlers = eventHandlers.at(eventClass);
             for (const auto& handler : handlers)
             {
-                auto rc = handler(request, payloadLength, formatVersion, tid,
-                                  offset);
+                auto rc =
+                    handler(request, payloadLength, formatVersion, tid, offset);
                 if (rc != PLDM_SUCCESS)
                 {
                     return CmdHandler::ccOnlyResponse(request, rc);
@@ -414,8 +415,8 @@
     uint16_t sensorId{};
     uint8_t eventClass{};
     size_t eventClassDataOffset{};
-    auto eventData = reinterpret_cast<const uint8_t*>(request->payload) +
-                     eventDataOffset;
+    auto eventData =
+        reinterpret_cast<const uint8_t*>(request->payload) + eventDataOffset;
     auto eventDataSize = payloadLength - eventDataOffset;
 
     auto rc = decode_sensor_event_data(eventData, eventDataSize, &sensorId,
@@ -427,8 +428,8 @@
 
     auto eventClassData = reinterpret_cast<const uint8_t*>(request->payload) +
                           eventDataOffset + eventClassDataOffset;
-    auto eventClassDataSize = payloadLength - eventDataOffset -
-                              eventClassDataOffset;
+    auto eventClassDataSize =
+        payloadLength - eventDataOffset - eventClassDataOffset;
 
     if (eventClass == PLDM_STATE_SENSOR_STATE)
     {
@@ -496,12 +497,13 @@
         }
 
         const auto& [containerId, entityType, entityInstance] = entityInfo;
-        events::StateSensorEntry stateSensorEntry{containerId,
-                                                  entityType,
-                                                  entityInstance,
-                                                  sensorOffset,
-                                                  stateSetIds[sensorOffset],
-                                                  false};
+        events::StateSensorEntry stateSensorEntry{
+            containerId,
+            entityType,
+            entityInstance,
+            sensorOffset,
+            stateSetIds[sensorOffset],
+            false};
         return hostPDRHandler->handleStateSensorEvent(stateSensorEntry,
                                                       eventState);
     }
@@ -513,17 +515,16 @@
     return PLDM_SUCCESS;
 }
 
-int Handler::pldmPDRRepositoryChgEvent(const pldm_msg* request,
-                                       size_t payloadLength,
-                                       uint8_t /*formatVersion*/, uint8_t tid,
-                                       size_t eventDataOffset)
+int Handler::pldmPDRRepositoryChgEvent(
+    const pldm_msg* request, size_t payloadLength, uint8_t /*formatVersion*/,
+    uint8_t tid, size_t eventDataOffset)
 {
     uint8_t eventDataFormat{};
     uint8_t numberOfChangeRecords{};
     size_t dataOffset{};
 
-    auto eventData = reinterpret_cast<const uint8_t*>(request->payload) +
-                     eventDataOffset;
+    auto eventData =
+        reinterpret_cast<const uint8_t*>(request->payload) + eventDataOffset;
     auto eventDataSize = payloadLength - eventDataOffset;
 
     auto rc = decode_pldm_pdr_repository_chg_event_data(
@@ -569,8 +570,8 @@
                 }
 
                 rc = getPDRRecordHandles(
-                    reinterpret_cast<const ChangeEntry*>(changeRecordData +
-                                                         dataOffset),
+                    reinterpret_cast<const ChangeEntry*>(
+                        changeRecordData + dataOffset),
                     changeRecordDataSize - dataOffset,
                     static_cast<size_t>(numberOfChangeEntries),
                     pdrRecordHandles);
@@ -581,8 +582,8 @@
                 }
             }
 
-            changeRecordData += dataOffset +
-                                (numberOfChangeEntries * sizeof(ChangeEntry));
+            changeRecordData +=
+                dataOffset + (numberOfChangeEntries * sizeof(ChangeEntry));
             changeRecordDataSize -=
                 dataOffset + (numberOfChangeEntries * sizeof(ChangeEntry));
         }
@@ -618,10 +619,9 @@
     return PLDM_SUCCESS;
 }
 
-int Handler::getPDRRecordHandles(const ChangeEntry* changeEntryData,
-                                 size_t changeEntryDataSize,
-                                 size_t numberOfChangeEntries,
-                                 PDRRecordHandles& pdrRecordHandles)
+int Handler::getPDRRecordHandles(
+    const ChangeEntry* changeEntryData, size_t changeEntryDataSize,
+    size_t numberOfChangeEntries, PDRRecordHandles& pdrRecordHandles)
 {
     if (numberOfChangeEntries > (changeEntryDataSize / sizeof(ChangeEntry)))
     {
@@ -672,11 +672,11 @@
     // PresentValue (uint8|sint8|uint16|sint16|uint32|sint32 )
     // Size of PendingValue and PresentValue calculated based on size is
     // provided in effecter data size
-    size_t responsePayloadLength = sizeof(completionCode) +
-                                   sizeof(effecterDataSize) +
-                                   sizeof(effecterOperationalState) +
-                                   getEffecterDataSize(effecterDataSize) +
-                                   getEffecterDataSize(effecterDataSize);
+    size_t responsePayloadLength =
+        sizeof(completionCode) + sizeof(effecterDataSize) +
+        sizeof(effecterOperationalState) +
+        getEffecterDataSize(effecterDataSize) +
+        getEffecterDataSize(effecterDataSize);
 
     Response response(responsePayloadLength + sizeof(pldm_msg_hdr));
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
@@ -698,8 +698,8 @@
 Response Handler::setNumericEffecterValue(const pldm_msg* request,
                                           size_t payloadLength)
 {
-    Response response(sizeof(pldm_msg_hdr) +
-                      PLDM_SET_NUMERIC_EFFECTER_VALUE_RESP_BYTES);
+    Response response(
+        sizeof(pldm_msg_hdr) + PLDM_SET_NUMERIC_EFFECTER_VALUE_RESP_BYTES);
     uint16_t effecterId{};
     uint8_t effecterDataSize{};
     uint8_t effecterValue[4] = {};
@@ -718,9 +718,9 @@
     {
         const pldm::utils::DBusHandler dBusIntf;
         rc = platform_numeric_effecter::setNumericEffecterValueHandler<
-            pldm::utils::DBusHandler, Handler>(dBusIntf, *this, effecterId,
-                                               effecterDataSize, effecterValue,
-                                               sizeof(effecterValue));
+            pldm::utils::DBusHandler, Handler>(
+            dBusIntf, *this, effecterId, effecterDataSize, effecterValue,
+            sizeof(effecterValue));
     }
 
     return ccOnlyResponse(request, rc);
@@ -810,13 +810,13 @@
         return ccOnlyResponse(request, rc);
     }
 
-    Response response(sizeof(pldm_msg_hdr) +
-                      PLDM_GET_STATE_SENSOR_READINGS_MIN_RESP_BYTES +
-                      sizeof(get_sensor_state_field) * comSensorCnt);
+    Response response(
+        sizeof(pldm_msg_hdr) + PLDM_GET_STATE_SENSOR_READINGS_MIN_RESP_BYTES +
+        sizeof(get_sensor_state_field) * comSensorCnt);
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
-    rc = encode_get_state_sensor_readings_resp(request->hdr.instance_id, rc,
-                                               comSensorCnt, stateField.data(),
-                                               responsePtr);
+    rc = encode_get_state_sensor_readings_resp(
+        request->hdr.instance_id, rc, comSensorCnt, stateField.data(),
+        responsePtr);
     if (rc != PLDM_SUCCESS)
     {
         return ccOnlyResponse(request, rc);
@@ -973,8 +973,8 @@
 
 void Handler::setEventReceiver()
 {
-    std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
-                                    PLDM_SET_EVENT_RECEIVER_REQ_BYTES);
+    std::vector<uint8_t> requestMsg(
+        sizeof(pldm_msg_hdr) + PLDM_SET_EVENT_RECEIVER_REQ_BYTES);
     auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
     auto instanceId = instanceIdDb->next(eid);
     uint8_t eventMessageGlobalEnable =
@@ -995,8 +995,9 @@
         return;
     }
 
-    auto processSetEventReceiverResponse =
-        [](mctp_eid_t /*eid*/, const pldm_msg* response, size_t respMsgLen) {
+    auto processSetEventReceiverResponse = [](mctp_eid_t /*eid*/,
+                                              const pldm_msg* response,
+                                              size_t respMsgLen) {
         if (response == nullptr || !respMsgLen)
         {
             error("Failed to receive response for setEventReceiver command");
diff --git a/libpldmresponder/platform.hpp b/libpldmresponder/platform.hpp
index e43058e..47c9ecf 100644
--- a/libpldmresponder/platform.hpp
+++ b/libpldmresponder/platform.hpp
@@ -28,9 +28,9 @@
 {
 namespace platform
 {
-using generatePDR = std::function<void(const pldm::utils::DBusHandler& dBusIntf,
-                                       const pldm::utils::Json& json,
-                                       pdr_utils::RepoInterface& repo)>;
+using generatePDR = std::function<void(
+    const pldm::utils::DBusHandler& dBusIntf, const pldm::utils::Json& json,
+    pdr_utils::RepoInterface& repo)>;
 
 using EffecterId = uint16_t;
 using DbusObjMaps =
@@ -58,8 +58,7 @@
             pldm::requester::Handler<pldm::requester::Request>* handler,
             sdeventplus::Event& event, bool buildPDRLazily = false,
             const std::optional<EventMap>& addOnHandlersMap = std::nullopt) :
-        eid(eid),
-        instanceIdDb(instanceIdDb), pdrRepo(repo),
+        eid(eid), instanceIdDb(instanceIdDb), pdrRepo(repo),
         hostPDRHandler(hostPDRHandler),
         dbusToPLDMEventHandler(dbusToPLDMEventHandler), fruHandler(fruHandler),
         dBusIntf(dBusIntf), platformConfigHandler(platformConfigHandler),
@@ -76,47 +75,48 @@
         handlers.emplace(
             PLDM_GET_PDR,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getPDR(request, payloadLength);
-        });
+                return this->getPDR(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_SET_NUMERIC_EFFECTER_VALUE,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->setNumericEffecterValue(request, payloadLength);
-        });
+                return this->setNumericEffecterValue(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_GET_NUMERIC_EFFECTER_VALUE,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getNumericEffecterValue(request, payloadLength);
-        });
+                return this->getNumericEffecterValue(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_SET_STATE_EFFECTER_STATES,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->setStateEffecterStates(request, payloadLength);
-        });
+                return this->setStateEffecterStates(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_PLATFORM_EVENT_MESSAGE,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->platformEventMessage(request, payloadLength);
-        });
+                return this->platformEventMessage(request, payloadLength);
+            });
         handlers.emplace(
             PLDM_GET_STATE_SENSOR_READINGS,
             [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
-            return this->getStateSensorReadings(request, payloadLength);
-        });
+                return this->getStateSensorReadings(request, payloadLength);
+            });
 
         // Default handler for PLDM Events
         eventHandlers[PLDM_SENSOR_EVENT].emplace_back(
             [this](const pldm_msg* request, size_t payloadLength,
                    uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
-            return this->sensorEvent(request, payloadLength, formatVersion, tid,
-                                     eventDataOffset);
-        });
+                return this->sensorEvent(request, payloadLength, formatVersion,
+                                         tid, eventDataOffset);
+            });
         eventHandlers[PLDM_PDR_REPOSITORY_CHG_EVENT].emplace_back(
             [this](const pldm_msg* request, size_t payloadLength,
                    uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
-            return this->pldmPDRRepositoryChgEvent(
-                request, payloadLength, formatVersion, tid, eventDataOffset);
-        });
+                return this->pldmPDRRepositoryChgEvent(
+                    request, payloadLength, formatVersion, tid,
+                    eventDataOffset);
+            });
 
         // Additional OEM event handlers for PLDM events, append it to the
         // standard handlers
@@ -359,8 +359,8 @@
             if (pdr->effecter_id != effecterId)
             {
                 pdr = nullptr;
-                pdrRecord = stateEffecterPDRs.getNextRecord(pdrRecord,
-                                                            pdrEntry);
+                pdrRecord =
+                    stateEffecterPDRs.getNextRecord(pdrRecord, pdrEntry);
                 continue;
             }
 
@@ -385,15 +385,15 @@
         int rc = PLDM_SUCCESS;
         try
         {
-            const auto& [dbusMappings,
-                         dbusValMaps] = effecterDbusObjMaps.at(effecterId);
+            const auto& [dbusMappings, dbusValMaps] =
+                effecterDbusObjMaps.at(effecterId);
             for (uint8_t currState = 0; currState < compEffecterCnt;
                  ++currState)
             {
                 std::vector<StateSetNum> allowed{};
                 // computation is based on table 79 from DSP0248 v1.1.1
-                uint8_t bitfieldIndex = stateField[currState].effecter_state /
-                                        8;
+                uint8_t bitfieldIndex =
+                    stateField[currState].effecter_state / 8;
                 uint8_t bit = stateField[currState].effecter_state -
                               (8 * bitfieldIndex);
                 if (states->possible_states_size < bitfieldIndex ||
diff --git a/libpldmresponder/platform_config.cpp b/libpldmresponder/platform_config.cpp
index 8d7fe79..8f181f1 100644
--- a/libpldmresponder/platform_config.cpp
+++ b/libpldmresponder/platform_config.cpp
@@ -41,8 +41,8 @@
 
     if (!names.empty())
     {
-        std::optional<std::string> sysType = getSysSpecificJsonDir(sysDirPath,
-                                                                   names);
+        std::optional<std::string> sysType =
+            getSysSpecificJsonDir(sysDirPath, names);
         if (sysType.has_value())
         {
             systemType = sysType.value();
@@ -136,9 +136,8 @@
     return std::nullopt;
 }
 
-std::optional<std::string>
-    Handler::getSysSpecificJsonDir(const fs::path& dirPath,
-                                   const std::vector<std::string>& dirNames)
+std::optional<std::string> Handler::getSysSpecificJsonDir(
+    const fs::path& dirPath, const std::vector<std::string>& dirNames)
 {
     // The current setup assumes that the BIOS and PDR configurations always
     // come from the same system type. If, in the future, we need to use BIOS
diff --git a/libpldmresponder/platform_config.hpp b/libpldmresponder/platform_config.hpp
index 578751b..770a2df 100644
--- a/libpldmresponder/platform_config.hpp
+++ b/libpldmresponder/platform_config.hpp
@@ -53,9 +53,8 @@
      *  @param[in] dirNames - System names retrieved from remote application
      *  @return - The system type information
      */
-    std::optional<std::string>
-        getSysSpecificJsonDir(const fs::path& dirPath,
-                              const std::vector<std::string>& dirNames);
+    std::optional<std::string> getSysSpecificJsonDir(
+        const fs::path& dirPath, const std::vector<std::string>& dirNames);
 
     /** @brief system type/model */
     std::string systemType;
diff --git a/libpldmresponder/platform_numeric_effecter.hpp b/libpldmresponder/platform_numeric_effecter.hpp
index 86f72c9..afb24fe 100644
--- a/libpldmresponder/platform_numeric_effecter.hpp
+++ b/libpldmresponder/platform_numeric_effecter.hpp
@@ -184,10 +184,9 @@
  *  @return std::pair<int, std::optional<PropertyValue>> - rc:Success or
  *          failure, PropertyValue: The value to be set
  */
-std::pair<int, std::optional<pldm::utils::PropertyValue>>
-    convertToDbusValue(const pldm_numeric_effecter_value_pdr* pdr,
-                       uint8_t effecterDataSize, uint8_t* effecterValue,
-                       std::string propertyType)
+std::pair<int, std::optional<pldm::utils::PropertyValue>> convertToDbusValue(
+    const pldm_numeric_effecter_value_pdr* pdr, uint8_t effecterDataSize,
+    uint8_t* effecterValue, std::string propertyType)
 {
     if (effecterDataSize == PLDM_EFFECTER_DATA_SIZE_UINT8)
     {
@@ -245,11 +244,10 @@
  * terms of PLDM completion codes if at least one state fails to be set
  */
 template <class DBusInterface, class Handler>
-int setNumericEffecterValueHandler(const DBusInterface& dBusIntf,
-                                   Handler& handler, uint16_t effecterId,
-                                   uint8_t effecterDataSize,
-                                   uint8_t* effecterValue,
-                                   size_t effecterValueLength)
+int setNumericEffecterValueHandler(
+    const DBusInterface& dBusIntf, Handler& handler, uint16_t effecterId,
+    uint8_t effecterDataSize, uint8_t* effecterValue,
+    size_t effecterValueLength)
 {
     constexpr auto effecterValueArrayLength = 4;
     pldm_numeric_effecter_value_pdr* pdr = nullptr;
@@ -302,8 +300,8 @@
 
     try
     {
-        const auto& [dbusMappings,
-                     dbusValMaps] = handler.getDbusObjMaps(effecterId);
+        const auto& [dbusMappings, dbusValMaps] =
+            handler.getDbusObjMaps(effecterId);
         pldm::utils::DBusMapping dbusMapping{
             dbusMappings[0].objectPath, dbusMappings[0].interface,
             dbusMappings[0].propertyName, dbusMappings[0].propertyType};
@@ -432,12 +430,10 @@
  *
  *  @return PLDM_SUCCESS/PLDM_ERROR
  */
-int getNumericEffecterValueHandler(const std::string& propertyType,
-                                   pldm::utils::PropertyValue propertyValue,
-                                   uint8_t effecterDataSize,
-                                   pldm_msg* responsePtr,
-                                   size_t responsePayloadLength,
-                                   uint8_t instanceId)
+int getNumericEffecterValueHandler(
+    const std::string& propertyType, pldm::utils::PropertyValue propertyValue,
+    uint8_t effecterDataSize, pldm_msg* responsePtr,
+    size_t responsePayloadLength, uint8_t instanceId)
 {
     if (propertyType == "uint8_t")
     {
@@ -537,8 +533,8 @@
     pldm::utils::DBusMapping dbusMapping{};
     try
     {
-        const auto& [dbusMappings,
-                     dbusValMaps] = handler.getDbusObjMaps(effecterId);
+        const auto& [dbusMappings, dbusValMaps] =
+            handler.getDbusObjMaps(effecterId);
         if (dbusMappings.size() > 0)
         {
             dbusMapping = {
diff --git a/libpldmresponder/platform_state_effecter.hpp b/libpldmresponder/platform_state_effecter.hpp
index 106cbc1..c6f7432 100644
--- a/libpldmresponder/platform_state_effecter.hpp
+++ b/libpldmresponder/platform_state_effecter.hpp
@@ -97,8 +97,8 @@
     int rc = PLDM_SUCCESS;
     try
     {
-        const auto& [dbusMappings,
-                     dbusValMaps] = handler.getDbusObjMaps(effecterId);
+        const auto& [dbusMappings, dbusValMaps] =
+            handler.getDbusObjMaps(effecterId);
         if (dbusMappings.empty() || dbusValMaps.empty())
         {
             error("DbusMappings for effecter ID '{EFFECTER_ID}' is missing",
diff --git a/libpldmresponder/test/libpldmresponder_base_test.cpp b/libpldmresponder/test/libpldmresponder_base_test.cpp
index 0387209..4656882 100644
--- a/libpldmresponder/test/libpldmresponder_base_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_base_test.cpp
@@ -82,8 +82,8 @@
     uint8_t retFlag = PLDM_START_AND_END;
     ver32_t version = {0x00, 0xF0, 0xF0, 0xF1};
 
-    auto rc = encode_get_version_req(0, transferHandle, flag, pldmType,
-                                     request);
+    auto rc =
+        encode_get_version_req(0, transferHandle, flag, pldmType, request);
 
     ASSERT_EQ(0, rc);
 
@@ -113,8 +113,8 @@
     uint32_t transferHandle = 0x0;
     uint8_t flag = PLDM_GET_FIRSTPART;
 
-    auto rc = encode_get_version_req(0, transferHandle, flag, pldmType,
-                                     request);
+    auto rc =
+        encode_get_version_req(0, transferHandle, flag, pldmType, request);
 
     ASSERT_EQ(0, rc);
 
diff --git a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
index ea29015..9b4f74e 100644
--- a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
@@ -98,25 +98,26 @@
     EXPECT_TRUE(attrTable);
     EXPECT_TRUE(attrValueTable);
 
-    std::set<std::string> expectedStrings = {"HMCManagedState",
-                                             "On",
-                                             "Off",
-                                             "FWBootSide",
-                                             "Perm",
-                                             "Temp",
-                                             "InbandCodeUpdate",
-                                             "Allowed",
-                                             "Allowed",
-                                             "NotAllowed",
-                                             "CodeUpdatePolicy",
-                                             "Concurrent",
-                                             "Disruptive",
-                                             "VDD_AVSBUS_RAIL",
-                                             "SBE_IMAGE_MINIMUM_VALID_ECS",
-                                             "INTEGER_INVALID_CASE",
-                                             "str_example1",
-                                             "str_example2",
-                                             "str_example3"};
+    std::set<std::string> expectedStrings = {
+        "HMCManagedState",
+        "On",
+        "Off",
+        "FWBootSide",
+        "Perm",
+        "Temp",
+        "InbandCodeUpdate",
+        "Allowed",
+        "Allowed",
+        "NotAllowed",
+        "CodeUpdatePolicy",
+        "Concurrent",
+        "Disruptive",
+        "VDD_AVSBUS_RAIL",
+        "SBE_IMAGE_MINIMUM_VALID_ECS",
+        "INTEGER_INVALID_CASE",
+        "str_example1",
+        "str_example2",
+        "str_example3"};
     std::set<std::string> strings;
     for (auto entry : BIOSTableIter<PLDM_BIOS_STRING_TABLE>(
              stringTable->data(), stringTable->size()))
@@ -206,8 +207,8 @@
              attrValueTable->data(), attrValueTable->size()))
     {
         auto header = table::attribute_value::decodeHeader(entry);
-        auto attrEntry = table::attribute::findByHandle(*attrTable,
-                                                        header.attrHandle);
+        auto attrEntry =
+            table::attribute::findByHandle(*attrTable, header.attrHandle);
         auto attrHeader = table::attribute::decodeHeader(attrEntry);
         auto attrName = biosStringTable.findString(attrHeader.stringHandle);
         auto jsonEntry = findJsonEntry(attrName);
@@ -368,9 +369,8 @@
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     auto attrValueTable = biosConfig.getBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE);
-    auto findEntry =
-        [&attrValueTable](
-            uint16_t handle) -> const pldm_bios_attr_val_table_entry* {
+    auto findEntry = [&attrValueTable](uint16_t handle)
+        -> const pldm_bios_attr_val_table_entry* {
         for (auto entry : BIOSTableIter<PLDM_BIOS_ATTR_VAL_TABLE>(
                  attrValueTable->data(), attrValueTable->size()))
         {
diff --git a/libpldmresponder/test/libpldmresponder_fru_test.cpp b/libpldmresponder/test/libpldmresponder_fru_test.cpp
index d654fca..f4a1202 100644
--- a/libpldmresponder/test/libpldmresponder_fru_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_fru_test.cpp
@@ -134,8 +134,8 @@
     mockedFruHandler.updateAssociationTree(
         objects, "/xyz/openbmc_project/inventory/system/chassis/motherboard");
 
-    pldm_entity_node* node = pldm_entity_association_tree_find(entityTree.get(),
-                                                               &systemEntity);
+    pldm_entity_node* node =
+        pldm_entity_association_tree_find(entityTree.get(), &systemEntity);
     EXPECT_TRUE(node != NULL);
 
     node = pldm_entity_association_tree_find(entityTree.get(), &chassisEntity);
@@ -143,8 +143,8 @@
     test_pldm_entity_node* test_node = (test_pldm_entity_node*)node;
     EXPECT_TRUE((test_node->parent).entity_type == systemEntity.entity_type);
 
-    node = pldm_entity_association_tree_find(entityTree.get(),
-                                             &motherboardEntity);
+    node =
+        pldm_entity_association_tree_find(entityTree.get(), &motherboardEntity);
     ASSERT_TRUE(node != NULL);
     test_node = (test_pldm_entity_node*)node;
     EXPECT_TRUE((test_node->parent).entity_type == chassisEntity.entity_type);
diff --git a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
index 6ef74b7..87ee867 100644
--- a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
@@ -69,8 +69,8 @@
     bf1.byte = 2;
     ASSERT_EQ(states->states[0].byte, bf1.byte);
 
-    const auto& [dbusMappings1,
-                 dbusValMaps1] = handler.getDbusObjMaps(pdr->effecter_id);
+    const auto& [dbusMappings1, dbusValMaps1] =
+        handler.getDbusObjMaps(pdr->effecter_id);
     ASSERT_EQ(dbusMappings1[0].objectPath, "/foo/bar");
 
     // Check second PDR
@@ -109,8 +109,8 @@
     ASSERT_EQ(states->states[0].byte, bf2[0].byte);
     ASSERT_EQ(states->states[1].byte, bf2[1].byte);
 
-    const auto& [dbusMappings2,
-                 dbusValMaps2] = handler.getDbusObjMaps(pdr->effecter_id);
+    const auto& [dbusMappings2, dbusValMaps2] =
+        handler.getDbusObjMaps(pdr->effecter_id);
     ASSERT_EQ(dbusMappings2[0].objectPath, "/foo/bar");
     ASSERT_EQ(dbusMappings2[1].objectPath, "/foo/bar");
 
@@ -157,8 +157,8 @@
     EXPECT_EQ(pdr->effecter_id, 3);
     EXPECT_EQ(pdr->effecter_data_size, 4);
 
-    const auto& [dbusMappings,
-                 dbusValMaps] = handler.getDbusObjMaps(pdr->effecter_id);
+    const auto& [dbusMappings, dbusValMaps] =
+        handler.getDbusObjMaps(pdr->effecter_id);
     EXPECT_EQ(dbusMappings[0].objectPath, "/foo/bar");
     EXPECT_EQ(dbusMappings[0].interface, "xyz.openbmc_project.Foo.Bar");
     EXPECT_EQ(dbusMappings[0].propertyName, "propertyName");
diff --git a/libpldmresponder/test/libpldmresponder_platform_test.cpp b/libpldmresponder/test/libpldmresponder_platform_test.cpp
index 63e26e2..d3606f5 100644
--- a/libpldmresponder/test/libpldmresponder_platform_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_platform_test.cpp
@@ -307,15 +307,13 @@
         MockdBusHandler, Handler>(mockedUtils, handler, 0x1, stateField);
     ASSERT_EQ(rc, PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE);
 
-    rc = platform_state_effecter::setStateEffecterStatesHandler<MockdBusHandler,
-                                                                Handler>(
-        mockedUtils, handler, 0x9, stateField);
+    rc = platform_state_effecter::setStateEffecterStatesHandler<
+        MockdBusHandler, Handler>(mockedUtils, handler, 0x9, stateField);
     ASSERT_EQ(rc, PLDM_PLATFORM_INVALID_EFFECTER_ID);
 
     stateField.push_back({PLDM_REQUEST_SET, 4});
-    rc = platform_state_effecter::setStateEffecterStatesHandler<MockdBusHandler,
-                                                                Handler>(
-        mockedUtils, handler, 0x1, stateField);
+    rc = platform_state_effecter::setStateEffecterStatesHandler<
+        MockdBusHandler, Handler>(mockedUtils, handler, 0x1, stateField);
     ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
 
     pldm_pdr_destroy(inPDRRepo);
@@ -444,18 +442,17 @@
                                        StrEq("xyz.openbmc_project.Foo.Bar")))
         .WillOnce(Return(PropertyValue(static_cast<uint64_t>(effecterValue))));
 
-    auto rc = platform_numeric_effecter::getNumericEffecterData<MockdBusHandler,
-                                                                Handler>(
-        mockedUtils, handler, effecterId, effecterDataSize, propertyType,
-        dbusValue);
+    auto rc = platform_numeric_effecter::getNumericEffecterData<
+        MockdBusHandler, Handler>(mockedUtils, handler, effecterId,
+                                  effecterDataSize, propertyType, dbusValue);
 
     ASSERT_EQ(rc, 0);
 
-    size_t responsePayloadLength = sizeof(completionCode) +
-                                   sizeof(effecterDataSize) +
-                                   sizeof(effecterOperationalState) +
-                                   getEffecterDataSize(effecterDataSize) +
-                                   getEffecterDataSize(effecterDataSize);
+    size_t responsePayloadLength =
+        sizeof(completionCode) + sizeof(effecterDataSize) +
+        sizeof(effecterOperationalState) +
+        getEffecterDataSize(effecterDataSize) +
+        getEffecterDataSize(effecterDataSize);
 
     Response response(responsePayloadLength + sizeof(pldm_msg_hdr));
     auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
@@ -511,10 +508,9 @@
     pldm::utils::PropertyValue dbusValue;
     std::string propertyType;
 
-    auto rc = platform_numeric_effecter::getNumericEffecterData<MockdBusHandler,
-                                                                Handler>(
-        mockedUtils, handler, effecterId, effecterDataSize, propertyType,
-        dbusValue);
+    auto rc = platform_numeric_effecter::getNumericEffecterData<
+        MockdBusHandler, Handler>(mockedUtils, handler, effecterId,
+                                  effecterDataSize, propertyType, dbusValue);
 
     ASSERT_EQ(rc, 128);
 
@@ -526,15 +522,15 @@
 {
     // Sample state sensor with SensorID - 1, EntityType - Processor Module(67)
     // State Set ID - Operational Running Status(11), Supported States - 3,4
-    std::vector<uint8_t> sample1PDR{0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00,
-                                    0x00, 0x17, 0x00, 0x00, 0x00, 0x01, 0x00,
-                                    0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
-                                    0x00, 0x01, 0x0b, 0x00, 0x01, 0x18};
+    std::vector<uint8_t> sample1PDR{
+        0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x17,
+        0x00, 0x00, 0x00, 0x01, 0x00, 0x43, 0x00, 0x01, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x00, 0x01, 0x18};
 
-    const auto& [terminusHandle1, sensorID1,
-                 sensorInfo1] = parseStateSensorPDR(sample1PDR);
-    const auto& [containerID1, entityType1,
-                 entityInstance1] = std::get<0>(sensorInfo1);
+    const auto& [terminusHandle1, sensorID1, sensorInfo1] =
+        parseStateSensorPDR(sample1PDR);
+    const auto& [containerID1, entityType1, entityInstance1] =
+        std::get<0>(sensorInfo1);
     const auto& states1 = std::get<1>(sensorInfo1);
     CompositeSensorStates statesCmp1{{3u, 4u}};
 
@@ -547,15 +543,15 @@
 
     // Sample state sensor with SensorID - 2, EntityType - System Firmware(31)
     // State Set ID - Availability(2), Supported States - 3,4,9,10,11,13
-    std::vector<uint8_t> sample2PDR{0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00,
-                                    0x00, 0x17, 0x00, 0x00, 0x00, 0x02, 0x00,
-                                    0x1F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
-                                    0x00, 0x01, 0x02, 0x00, 0x02, 0x18, 0x2E};
+    std::vector<uint8_t> sample2PDR{
+        0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x17, 0x00,
+        0x00, 0x00, 0x02, 0x00, 0x1F, 0x00, 0x01, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x01, 0x02, 0x00, 0x02, 0x18, 0x2E};
 
-    const auto& [terminusHandle2, sensorID2,
-                 sensorInfo2] = parseStateSensorPDR(sample2PDR);
-    const auto& [containerID2, entityType2,
-                 entityInstance2] = std::get<0>(sensorInfo2);
+    const auto& [terminusHandle2, sensorID2, sensorInfo2] =
+        parseStateSensorPDR(sample2PDR);
+    const auto& [containerID2, entityType2, entityInstance2] =
+        std::get<0>(sensorInfo2);
     const auto& states2 = std::get<1>(sensorInfo2);
     CompositeSensorStates statesCmp2{{3u, 4u, 9u, 10u, 11u, 13u}};
 
@@ -575,10 +571,10 @@
         0x00, 0x03, 0x00, 0x21, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
         0x02, 0x21, 0x00, 0x01, 0x06, 0x0F, 0x00, 0x01, 0x1E};
 
-    const auto& [terminusHandle3, sensorID3,
-                 sensorInfo3] = parseStateSensorPDR(sample3PDR);
-    const auto& [containerID3, entityType3,
-                 entityInstance3] = std::get<0>(sensorInfo3);
+    const auto& [terminusHandle3, sensorID3, sensorInfo3] =
+        parseStateSensorPDR(sample3PDR);
+    const auto& [containerID3, entityType3, entityInstance3] =
+        std::get<0>(sensorInfo3);
     const auto& states3 = std::get<1>(sensorInfo3);
     CompositeSensorStates statesCmp3{{1u, 2u}, {1u, 2u, 3u, 4u}};
 
diff --git a/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp b/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp
index 0c7cc8c..9b7fe8a 100644
--- a/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp
@@ -105,25 +105,26 @@
     EXPECT_TRUE(attrTable);
     EXPECT_TRUE(attrValueTable);
 
-    std::set<std::string> expectedStrings = {"HMCManagedState",
-                                             "On",
-                                             "Off",
-                                             "FWBootSide",
-                                             "Perm",
-                                             "Temp",
-                                             "InbandCodeUpdate",
-                                             "Allowed",
-                                             "Allowed",
-                                             "NotAllowed",
-                                             "CodeUpdatePolicy",
-                                             "Concurrent",
-                                             "Disruptive",
-                                             "VDD_AVSBUS_RAIL",
-                                             "SBE_IMAGE_MINIMUM_VALID_ECS",
-                                             "INTEGER_INVALID_CASE",
-                                             "str_example1",
-                                             "str_example2",
-                                             "str_example3"};
+    std::set<std::string> expectedStrings = {
+        "HMCManagedState",
+        "On",
+        "Off",
+        "FWBootSide",
+        "Perm",
+        "Temp",
+        "InbandCodeUpdate",
+        "Allowed",
+        "Allowed",
+        "NotAllowed",
+        "CodeUpdatePolicy",
+        "Concurrent",
+        "Disruptive",
+        "VDD_AVSBUS_RAIL",
+        "SBE_IMAGE_MINIMUM_VALID_ECS",
+        "INTEGER_INVALID_CASE",
+        "str_example1",
+        "str_example2",
+        "str_example3"};
     std::set<std::string> strings;
     for (auto entry : BIOSTableIter<PLDM_BIOS_STRING_TABLE>(
              stringTable->data(), stringTable->size()))
@@ -213,8 +214,8 @@
              attrValueTable->data(), attrValueTable->size()))
     {
         auto header = table::attribute_value::decodeHeader(entry);
-        auto attrEntry = table::attribute::findByHandle(*attrTable,
-                                                        header.attrHandle);
+        auto attrEntry =
+            table::attribute::findByHandle(*attrTable, header.attrHandle);
         auto attrHeader = table::attribute::decodeHeader(attrEntry);
         auto attrName = biosStringTable.findString(attrHeader.stringHandle);
         auto jsonEntry = findJsonEntry(attrName);
@@ -453,9 +454,8 @@
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     auto attrValueTable = biosConfig.getBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE);
-    auto findEntry =
-        [&attrValueTable](
-            uint16_t handle) -> const pldm_bios_attr_val_table_entry* {
+    auto findEntry = [&attrValueTable](uint16_t handle)
+        -> const pldm_bios_attr_val_table_entry* {
         for (auto entry : BIOSTableIter<PLDM_BIOS_ATTR_VAL_TABLE>(
                  attrValueTable->data(), attrValueTable->size()))
         {
