diff --git a/platform-mc/numeric_sensor.cpp b/platform-mc/numeric_sensor.cpp
index be7ece3..ad563fd 100644
--- a/platform-mc/numeric_sensor.cpp
+++ b/platform-mc/numeric_sensor.cpp
@@ -19,8 +19,7 @@
                              std::shared_ptr<pldm_numeric_sensor_value_pdr> pdr,
                              std::string& sensorName,
                              std::string& associationPath) :
-    tid(tid),
-    sensorName(sensorName), isPriority(false)
+    tid(tid), sensorName(sensorName), isPriority(false)
 {
     if (!pdr)
     {
@@ -294,8 +293,8 @@
 
     try
     {
-        availabilityIntf = std::make_unique<AvailabilityIntf>(bus,
-                                                              path.c_str());
+        availabilityIntf =
+            std::make_unique<AvailabilityIntf>(bus, path.c_str());
     }
     catch (const sdbusplus::exception_t& e)
     {
@@ -363,8 +362,7 @@
     const pldm_tid_t tid, const bool sensorDisabled,
     std::shared_ptr<pldm_compact_numeric_sensor_pdr> pdr,
     std::string& sensorName, std::string& associationPath) :
-    tid(tid),
-    sensorName(sensorName), isPriority(false)
+    tid(tid), sensorName(sensorName), isPriority(false)
 {
     if (!pdr)
     {
@@ -504,8 +502,8 @@
 
     try
     {
-        availabilityIntf = std::make_unique<AvailabilityIntf>(bus,
-                                                              path.c_str());
+        availabilityIntf =
+            std::make_unique<AvailabilityIntf>(bus, path.c_str());
     }
     catch (const sdbusplus::exception_t& e)
     {
diff --git a/platform-mc/numeric_sensor.hpp b/platform-mc/numeric_sensor.hpp
index 315787d..770a286 100644
--- a/platform-mc/numeric_sensor.hpp
+++ b/platform-mc/numeric_sensor.hpp
@@ -52,7 +52,7 @@
                   std::shared_ptr<pldm_compact_numeric_sensor_pdr> pdr,
                   std::string& sensorName, std::string& associationPath);
 
-    ~NumericSensor(){};
+    ~NumericSensor() {};
 
     /** @brief ConversionFormula is used to convert raw value to the unit
      * specified in PDR
diff --git a/platform-mc/platform_manager.cpp b/platform-mc/platform_manager.cpp
index 21e4bcf..f6ffcc5 100644
--- a/platform-mc/platform_manager.cpp
+++ b/platform-mc/platform_manager.cpp
@@ -53,9 +53,9 @@
     if (terminus->doesSupportCommand(PLDM_PLATFORM,
                                      PLDM_GET_PDR_REPOSITORY_INFO))
     {
-        auto rc = co_await getPDRRepositoryInfo(tid, repositoryState,
-                                                recordCount, repositorySize,
-                                                largestRecordSize);
+        auto rc =
+            co_await getPDRRepositoryInfo(tid, repositoryState, recordCount,
+                                          repositorySize, largestRecordSize);
         if (rc)
         {
             lg2::error(
@@ -64,8 +64,8 @@
         }
         else
         {
-            recordCount = std::min(recordCount + 1,
-                                   std::numeric_limits<uint32_t>::max());
+            recordCount =
+                std::min(recordCount + 1, std::numeric_limits<uint32_t>::max());
             largestRecordSize = std::min(largestRecordSize + 1,
                                          std::numeric_limits<uint32_t>::max());
         }
@@ -90,10 +90,10 @@
 
     do
     {
-        auto rc = co_await getPDR(tid, recordHndl, 0, PLDM_GET_FIRSTPART,
-                                  recvBufSize, 0, nextRecordHndl,
-                                  nextDataTransferHndl, transferFlag,
-                                  responseCnt, recvBuf, transferCrc);
+        auto rc =
+            co_await getPDR(tid, recordHndl, 0, PLDM_GET_FIRSTPART, recvBufSize,
+                            0, nextRecordHndl, nextDataTransferHndl,
+                            transferFlag, responseCnt, recvBuf, transferCrc);
 
         if (rc)
         {
@@ -121,11 +121,11 @@
                                              recvBuf.begin() + responseCnt);
             do
             {
-                rc = co_await getPDR(tid, recordHndl, nextDataTransferHndl,
-                                     PLDM_GET_NEXTPART, recvBufSize,
-                                     recordChgNum, nextRecordHndl,
-                                     nextDataTransferHndl, transferFlag,
-                                     responseCnt, recvBuf, transferCrc);
+                rc = co_await getPDR(
+                    tid, recordHndl, nextDataTransferHndl, PLDM_GET_NEXTPART,
+                    recvBufSize, recordChgNum, nextRecordHndl,
+                    nextDataTransferHndl, transferFlag, responseCnt, recvBuf,
+                    transferCrc);
                 if (rc)
                 {
                     lg2::error(
diff --git a/platform-mc/platform_manager.hpp b/platform-mc/platform_manager.hpp
index 8187ca1..8d6e7b4 100644
--- a/platform-mc/platform_manager.hpp
+++ b/platform-mc/platform_manager.hpp
@@ -31,8 +31,7 @@
 
     explicit PlatformManager(TerminusManager& terminusManager,
                              TerminiMapper& termini) :
-        terminusManager(terminusManager),
-        termini(termini)
+        terminusManager(terminusManager), termini(termini)
     {}
 
     /** @brief Initialize terminus which supports PLDM Type 2
@@ -83,11 +82,9 @@
      * *
      *  @return coroutine return_value - PLDM completion code
      */
-    exec::task<int> getPDRRepositoryInfo(const pldm_tid_t tid,
-                                         uint8_t& repositoryState,
-                                         uint32_t& recordCount,
-                                         uint32_t& repositorySize,
-                                         uint32_t& largestRecordSize);
+    exec::task<int> getPDRRepositoryInfo(
+        const pldm_tid_t tid, uint8_t& repositoryState, uint32_t& recordCount,
+        uint32_t& repositorySize, uint32_t& largestRecordSize);
 
     /** reference of TerminusManager for sending PLDM request to terminus*/
     TerminusManager& terminusManager;
diff --git a/platform-mc/terminus.cpp b/platform-mc/terminus.cpp
index 004158a..7b94bda 100644
--- a/platform-mc/terminus.cpp
+++ b/platform-mc/terminus.cpp
@@ -58,16 +58,17 @@
     auto it = std::find_if(
         entityAuxiliaryNamesTbl.begin(), entityAuxiliaryNamesTbl.end(),
         [](const std::shared_ptr<EntityAuxiliaryNames>& entityAuxiliaryNames) {
-        const auto& [key, entityNames] = *entityAuxiliaryNames;
-        /**
-         * There is only one Overal system container entity in one terminus.
-         * The entity auxiliary name PDR of that terminus with the that type of
-         * containerID will include terminus name.
-         **/
-        return (entityAuxiliaryNames &&
+            const auto& [key, entityNames] = *entityAuxiliaryNames;
+            /**
+             * There is only one Overal system container entity in one terminus.
+             * The entity auxiliary name PDR of that terminus with the that type
+             *of containerID will include terminus name.
+             **/
+            return (
+                entityAuxiliaryNames &&
                 key.containerId == PLDM_PLATFORM_ENTITY_SYSTEM_CONTAINER_ID &&
                 entityNames.size());
-    });
+        });
 
     if (it != entityAuxiliaryNamesTbl.end())
     {
@@ -234,9 +235,10 @@
         sensorAuxiliaryNamesTbl.begin(), sensorAuxiliaryNamesTbl.end(),
         [id](
             const std::shared_ptr<SensorAuxiliaryNames>& sensorAuxiliaryNames) {
-        const auto& [sensorId, sensorCnt, sensorNames] = *sensorAuxiliaryNames;
-        return sensorId == id;
-    });
+            const auto& [sensorId, sensorCnt, sensorNames] =
+                *sensorAuxiliaryNames;
+            return sensorId == id;
+        });
 
     if (it != sensorAuxiliaryNamesTbl.end())
     {
@@ -307,8 +309,8 @@
                         PLDM_PDR_ENTITY_AUXILIARY_NAME_PDR_MIN_LENGTH;
     auto names_size = pdrData.size() - names_offset;
 
-    size_t decodedPdrSize = sizeof(struct pldm_entity_auxiliary_names_pdr) +
-                            names_size;
+    size_t decodedPdrSize =
+        sizeof(struct pldm_entity_auxiliary_names_pdr) + names_size;
     auto vPdr = std::vector<char>(decodedPdrSize);
     auto decodedPdr =
         reinterpret_cast<struct pldm_entity_auxiliary_names_pdr*>(vPdr.data());
@@ -387,16 +389,16 @@
             "TID", tid);
         return;
     }
-    std::string sensorName = terminusName + "_" + "Sensor_" +
-                             std::to_string(pdr->sensor_id);
+    std::string sensorName =
+        terminusName + "_" + "Sensor_" + std::to_string(pdr->sensor_id);
 
     if (pdr->sensor_auxiliary_names_pdr)
     {
         auto sensorAuxiliaryNames = getSensorAuxiliaryNames(sensorId);
         if (sensorAuxiliaryNames)
         {
-            const auto& [sensorId, sensorCnt,
-                         sensorNames] = *sensorAuxiliaryNames;
+            const auto& [sensorId, sensorCnt, sensorNames] =
+                *sensorAuxiliaryNames;
             if (sensorCnt == 1)
             {
                 for (const auto& [languageTag, name] : sensorNames[0])
@@ -500,8 +502,8 @@
             "TID", tid);
         return;
     }
-    std::string sensorName = terminusName + "_" + "Sensor_" +
-                             std::to_string(pdr->sensor_id);
+    std::string sensorName =
+        terminusName + "_" + "Sensor_" + std::to_string(pdr->sensor_id);
 
     auto sensorAuxiliaryNames = getSensorAuxiliaryNames(sensorId);
     if (sensorAuxiliaryNames)
diff --git a/platform-mc/terminus.hpp b/platform-mc/terminus.hpp
index 8a39b2e..a819ad7 100644
--- a/platform-mc/terminus.hpp
+++ b/platform-mc/terminus.hpp
@@ -93,8 +93,8 @@
      */
     bool setSupportedCommands(const std::vector<uint8_t>& cmds)
     {
-        const size_t expectedSize = PLDM_MAX_TYPES *
-                                    (PLDM_MAX_CMDS_PER_TYPE / 8);
+        const size_t expectedSize =
+            PLDM_MAX_TYPES * (PLDM_MAX_CMDS_PER_TYPE / 8);
         if (cmds.empty() || cmds.size() != expectedSize)
         {
             lg2::error(
diff --git a/platform-mc/terminus_manager.cpp b/platform-mc/terminus_manager.cpp
index 93fdb09..7567d89 100644
--- a/platform-mc/terminus_manager.cpp
+++ b/platform-mc/terminus_manager.cpp
@@ -42,9 +42,9 @@
 
     auto mctpInfoTableIt = std::find_if(
         mctpInfoTable.begin(), mctpInfoTable.end(), [&mctpInfo](auto& v) {
-        return (std::get<0>(v.second) == std::get<0>(mctpInfo)) &&
-               (std::get<3>(v.second) == std::get<3>(mctpInfo));
-    });
+            return (std::get<0>(v.second) == std::get<0>(mctpInfo)) &&
+                   (std::get<3>(v.second) == std::get<3>(mctpInfo));
+        });
     if (mctpInfoTableIt == mctpInfoTable.end())
     {
         return std::nullopt;
@@ -86,9 +86,9 @@
 
     auto mctpInfoTableIt = std::find_if(
         mctpInfoTable.begin(), mctpInfoTable.end(), [&mctpInfo](auto& v) {
-        return (std::get<0>(v.second) == std::get<0>(mctpInfo)) &&
-               (std::get<3>(v.second) == std::get<3>(mctpInfo));
-    });
+            return (std::get<0>(v.second) == std::get<0>(mctpInfo)) &&
+                   (std::get<3>(v.second) == std::get<3>(mctpInfo));
+        });
     if (mctpInfoTableIt != mctpInfoTable.end())
     {
         return mctpInfoTableIt->first;
@@ -147,14 +147,15 @@
 TerminiMapper::iterator
     TerminusManager::findTerminusPtr(const MctpInfo& mctpInfo)
 {
-    auto foundIter = std::find_if(termini.begin(), termini.end(),
-                                  [&](const auto& terminusPair) {
-        auto terminusMctpInfo = toMctpInfo(terminusPair.first);
-        return (
-            terminusMctpInfo &&
-            (std::get<0>(terminusMctpInfo.value()) == std::get<0>(mctpInfo)) &&
-            (std::get<3>(terminusMctpInfo.value()) == std::get<3>(mctpInfo)));
-    });
+    auto foundIter = std::find_if(
+        termini.begin(), termini.end(), [&](const auto& terminusPair) {
+            auto terminusMctpInfo = toMctpInfo(terminusPair.first);
+            return (terminusMctpInfo &&
+                    (std::get<0>(terminusMctpInfo.value()) ==
+                     std::get<0>(mctpInfo)) &&
+                    (std::get<3>(terminusMctpInfo.value()) ==
+                     std::get<3>(mctpInfo)));
+        });
 
     return foundIter;
 }
@@ -359,10 +360,9 @@
     co_return PLDM_SUCCESS;
 }
 
-exec::task<int>
-    TerminusManager::sendRecvPldmMsgOverMctp(mctp_eid_t eid, Request& request,
-                                             const pldm_msg** responseMsg,
-                                             size_t* responseLen)
+exec::task<int> TerminusManager::sendRecvPldmMsgOverMctp(
+    mctp_eid_t eid, Request& request, const pldm_msg** responseMsg,
+    size_t* responseLen)
 {
     int rc = 0;
     try
@@ -471,8 +471,8 @@
     co_return responseMsg->payload[0];
 }
 
-exec::task<int> TerminusManager::getPLDMTypes(pldm_tid_t tid,
-                                              uint64_t& supportedTypes)
+exec::task<int>
+    TerminusManager::getPLDMTypes(pldm_tid_t tid, uint64_t& supportedTypes)
 {
     Request request(sizeof(pldm_msg_hdr));
     auto requestMsg = reinterpret_cast<pldm_msg*>(request.data());
@@ -498,8 +498,8 @@
 
     uint8_t completionCode = 0;
     bitfield8_t* types = reinterpret_cast<bitfield8_t*>(&supportedTypes);
-    rc = decode_get_types_resp(responseMsg, responseLen, &completionCode,
-                               types);
+    rc =
+        decode_get_types_resp(responseMsg, responseLen, &completionCode, types);
     if (rc)
     {
         lg2::error(
@@ -569,10 +569,9 @@
     co_return completionCode;
 }
 
-exec::task<int> TerminusManager::sendRecvPldmMsg(pldm_tid_t tid,
-                                                 Request& request,
-                                                 const pldm_msg** responseMsg,
-                                                 size_t* responseLen)
+exec::task<int> TerminusManager::sendRecvPldmMsg(
+    pldm_tid_t tid, Request& request, const pldm_msg** responseMsg,
+    size_t* responseLen)
 {
     /**
      * Size of tidPool is `std::numeric_limits<pldm_tid_t>::max() + 1`
diff --git a/platform-mc/terminus_manager.hpp b/platform-mc/terminus_manager.hpp
index 249fdff..d485de5 100644
--- a/platform-mc/terminus_manager.hpp
+++ b/platform-mc/terminus_manager.hpp
@@ -55,8 +55,7 @@
                              RequesterHandler& handler,
                              pldm::InstanceIdDb& instanceIdDb,
                              TerminiMapper& termini, Manager* manager) :
-        handler(handler),
-        instanceIdDb(instanceIdDb), termini(termini),
+        handler(handler), instanceIdDb(instanceIdDb), termini(termini),
         tidPool(tidPoolSize, false), manager(manager)
     {
         // DSP0240 v1.1.0 table-8, special value: 0,0xFF = reserved
@@ -100,10 +99,9 @@
      *  @param[out] responseLen - length of response PLDM message
      *  @return coroutine return_value - PLDM completion code
      */
-    virtual exec::task<int>
-        sendRecvPldmMsgOverMctp(mctp_eid_t eid, Request& request,
-                                const pldm_msg** responseMsg,
-                                size_t* responseLen);
+    virtual exec::task<int> sendRecvPldmMsgOverMctp(
+        mctp_eid_t eid, Request& request, const pldm_msg** responseMsg,
+        size_t* responseLen);
 
     /** @brief member functions to map/unmap tid
      */
@@ -135,8 +133,8 @@
      *
      *  @return tid - Terminus tid
      */
-    std::optional<pldm_tid_t> storeTerminusInfo(const MctpInfo& mctpInfo,
-                                                pldm_tid_t tid);
+    std::optional<pldm_tid_t>
+        storeTerminusInfo(const MctpInfo& mctpInfo, pldm_tid_t tid);
 
     /** @brief Member functions to remove the TID from the transportLayer and
      *         mctpInfo table
diff --git a/platform-mc/test/mock_terminus_manager.hpp b/platform-mc/test/mock_terminus_manager.hpp
index eb06734..4e56a83 100644
--- a/platform-mc/test/mock_terminus_manager.hpp
+++ b/platform-mc/test/mock_terminus_manager.hpp
@@ -20,10 +20,9 @@
         TerminusManager(event, handler, instanceIdDb, termini, manager)
     {}
 
-    exec::task<int> sendRecvPldmMsgOverMctp(mctp_eid_t /*eid*/,
-                                            Request& /*request*/,
-                                            const pldm_msg** responseMsg,
-                                            size_t* responseLen) override
+    exec::task<int> sendRecvPldmMsgOverMctp(
+        mctp_eid_t /*eid*/, Request& /*request*/, const pldm_msg** responseMsg,
+        size_t* responseLen) override
     {
         if (responseMsgs.empty() || responseMsg == nullptr ||
             responseLen == nullptr)
diff --git a/platform-mc/test/terminus_manager_test.cpp b/platform-mc/test/terminus_manager_test.cpp
index 464ef71..432ba21 100644
--- a/platform-mc/test/terminus_manager_test.cpp
+++ b/platform-mc/test/terminus_manager_test.cpp
@@ -266,9 +266,9 @@
         reinterpret_cast<pldm_msg*>(setTidResp0.data()), sizeof(setTidResp0));
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
-    uint8_t supportedType1Byte = (1 << (PLDM_BASE % 8)) +
-                                 (1 << (PLDM_PLATFORM % 8)) +
-                                 (1 << (PLDM_BIOS % 8)) + (1 << (PLDM_FRU % 8));
+    uint8_t supportedType1Byte =
+        (1 << (PLDM_BASE % 8)) + (1 << (PLDM_PLATFORM % 8)) +
+        (1 << (PLDM_BIOS % 8)) + (1 << (PLDM_FRU % 8));
     std::array<uint8_t, sizeof(pldm_msg_hdr) + getPldmTypesRespLen>
         getPldmTypesResp0{0x00, 0x02, 0x04, 0x00, supportedType1Byte,
                           0x00, 0x00, 0x00, 0x00, 0x00,
@@ -334,11 +334,11 @@
             (1 << (PLDM_GET_PLDM_TYPES % 8)) +
             (1 << (PLDM_GET_PLDM_COMMANDS % 8));
     std::array<uint8_t, sizeof(pldm_msg_hdr) + getPldmCommandRespLen>
-        getPldmCommandBaseResp0{0x00, 0x02, 0x05, 0x00, byte0, 0x00, 0x00, 0x00,
-                                0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00,
-                                0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00,
-                                0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00,
-                                0x00, 0x00, 0x00, 0x00};
+        getPldmCommandBaseResp0{
+            0x00, 0x02, 0x05, 0x00, byte0, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00, 0x00};
     rc = mockTerminusManager.enqueueResponse(
         reinterpret_cast<pldm_msg*>(getPldmCommandBaseResp0.data()),
         sizeof(getPldmCommandBaseResp0));
@@ -391,11 +391,11 @@
     byte1 = (0 << (PLDM_GET_BIOS_ATTRIBUTE_CURRENT_VALUE_BY_HANDLE % 8)) +
             (1 << (PLDM_GET_DATE_TIME % 8)) + (1 << (PLDM_SET_DATE_TIME % 8));
     std::array<uint8_t, sizeof(pldm_msg_hdr) + getPldmCommandRespLen>
-        getPldmCommandBiosResp0{0x00, 0x02, 0x05, 0x00, byte0, byte1, 0x00,
-                                0x00, 0x00, 0x00, 0x00, 0x00,  0x00,  0x00,
-                                0x00, 0x00, 0x00, 0x00, 0x00,  0x00,  0x00,
-                                0x00, 0x00, 0x00, 0x00, 0x00,  0x00,  0x00,
-                                0x00, 0x00, 0x00, 0x00, 0x00,  0x00,  0x00};
+        getPldmCommandBiosResp0{
+            0x00, 0x02, 0x05, 0x00, byte0, byte1, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00,  0x00,  0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00,  0x00,  0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00,  0x00,  0x00, 0x00};
     rc = mockTerminusManager.enqueueResponse(
         reinterpret_cast<pldm_msg*>(getPldmCommandBiosResp0.data()),
         sizeof(getPldmCommandBiosResp0));
@@ -411,11 +411,11 @@
     /* byte0 command from 8 to 15 */
     byte1 = 0;
     std::array<uint8_t, sizeof(pldm_msg_hdr) + getPldmCommandRespLen>
-        getPldmCommandFruResp0{0x00, 0x02, 0x05, 0x00, byte0, 0x00, 0x00,
-                               0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00,
-                               0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00,
-                               0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00,
-                               0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00};
+        getPldmCommandFruResp0{
+            0x00, 0x02, 0x05, 0x00, byte0, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00};
     rc = mockTerminusManager.enqueueResponse(
         reinterpret_cast<pldm_msg*>(getPldmCommandFruResp0.data()),
         sizeof(getPldmCommandFruResp0));
diff --git a/platform-mc/test/terminus_test.cpp b/platform-mc/test/terminus_test.cpp
index e4f00f9..0baa8b7 100644
--- a/platform-mc/test/terminus_test.cpp
+++ b/platform-mc/test/terminus_test.cpp
@@ -8,8 +8,8 @@
 TEST(TerminusTest, supportedTypeTest)
 {
     auto t1 = pldm::platform_mc::Terminus(1, 1 << PLDM_BASE);
-    auto t2 = pldm::platform_mc::Terminus(2,
-                                          1 << PLDM_BASE | 1 << PLDM_PLATFORM);
+    auto t2 =
+        pldm::platform_mc::Terminus(2, 1 << PLDM_BASE | 1 << PLDM_PLATFORM);
 
     EXPECT_EQ(true, t1.doesSupportType(PLDM_BASE));
     EXPECT_EQ(false, t1.doesSupportType(PLDM_PLATFORM));
@@ -27,8 +27,8 @@
 
 TEST(TerminusTest, parseSensorAuxiliaryNamesPDRTest)
 {
-    auto t1 = pldm::platform_mc::Terminus(1,
-                                          1 << PLDM_BASE | 1 << PLDM_PLATFORM);
+    auto t1 =
+        pldm::platform_mc::Terminus(1, 1 << PLDM_BASE | 1 << PLDM_PLATFORM);
     std::vector<uint8_t> pdr1{
         0x0,
         0x0,
@@ -110,8 +110,8 @@
 
 TEST(TerminusTest, parseSensorAuxiliaryMultiNamesPDRTest)
 {
-    auto t1 = pldm::platform_mc::Terminus(1,
-                                          1 << PLDM_BASE | 1 << PLDM_PLATFORM);
+    auto t1 =
+        pldm::platform_mc::Terminus(1, 1 << PLDM_BASE | 1 << PLDM_PLATFORM);
     std::vector<uint8_t> pdr1{
         0x0,
         0x0,
@@ -229,8 +229,8 @@
 
 TEST(TerminusTest, parseSensorAuxiliaryNamesMultiSensorsPDRTest)
 {
-    auto t1 = pldm::platform_mc::Terminus(1,
-                                          1 << PLDM_BASE | 1 << PLDM_PLATFORM);
+    auto t1 =
+        pldm::platform_mc::Terminus(1, 1 << PLDM_BASE | 1 << PLDM_PLATFORM);
     std::vector<uint8_t> pdr1{
         0x0,
         0x0,
@@ -350,8 +350,8 @@
 
 TEST(TerminusTest, parsePDRTestNoSensorPDR)
 {
-    auto t1 = pldm::platform_mc::Terminus(1,
-                                          1 << PLDM_BASE | 1 << PLDM_PLATFORM);
+    auto t1 =
+        pldm::platform_mc::Terminus(1, 1 << PLDM_BASE | 1 << PLDM_PLATFORM);
     std::vector<uint8_t> pdr1{
         0x1, 0x0, 0x0,
         0x0,                             // record handle
