diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -87,7 +87,7 @@
 IndentWrappedFunctionNames: true
 InsertNewlineAtEOF: true
 KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
 LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
@@ -98,13 +98,14 @@
 ObjCSpaceBeforeProtocolList: true
 PackConstructorInitializers: BinPack
 PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
 PenaltyBreakComment: 300
 PenaltyBreakFirstLessLess: 120
 PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
 PointerAlignment: Left
 QualifierAlignment: Left
 ReferenceAlignment: Left
diff --git a/common_utility.cpp b/common_utility.cpp
index c1c5e4f..0497d0f 100644
--- a/common_utility.cpp
+++ b/common_utility.cpp
@@ -55,8 +55,8 @@
     {
         auto bus = sdbusplus::bus::new_default();
         auto service = getService(bus, pimPath, pimIntf);
-        auto pimMsg = bus.new_method_call(service.c_str(), pimPath, pimIntf,
-                                          "Notify");
+        auto pimMsg =
+            bus.new_method_call(service.c_str(), pimPath, pimIntf, "Notify");
         pimMsg.append(std::move(objects));
         auto result = bus.call(pimMsg);
         if (result.is_method_error())
diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index 55a01ff..476d802 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -240,9 +240,8 @@
  * @param[out] interfaces - Reference to interface map.
  */
 template <typename T>
-static void populateFruSpecificInterfaces(const T& map,
-                                          const string& preIntrStr,
-                                          inventory::InterfaceMap& interfaces)
+static void populateFruSpecificInterfaces(
+    const T& map, const string& preIntrStr, inventory::InterfaceMap& interfaces)
 {
     inventory::PropertyMap prop;
 
@@ -376,8 +375,8 @@
                     if (!rec.empty() && !kw.empty() && vpdMap.count(rec) &&
                         vpdMap.at(rec).count(kw))
                     {
-                        auto encoded = encodeKeyword(vpdMap.at(rec).at(kw),
-                                                     encoding);
+                        auto encoded =
+                            encodeKeyword(vpdMap.at(rec).at(kw), encoding);
                         props.emplace(busProp, encoded);
                     }
                 }
@@ -387,8 +386,8 @@
                     {
                         if (auto kwValue = get_if<Binary>(&vpdMap.at(kw)))
                         {
-                            auto prop = string((*kwValue).begin(),
-                                               (*kwValue).end());
+                            auto prop =
+                                string((*kwValue).begin(), (*kwValue).end());
 
                             auto encoded = encodeKeyword(prop, encoding);
 
@@ -397,8 +396,8 @@
                         else if (auto kwValue =
                                      get_if<std::string>(&vpdMap.at(kw)))
                         {
-                            auto prop = string((*kwValue).begin(),
-                                               (*kwValue).end());
+                            auto prop =
+                                string((*kwValue).begin(), (*kwValue).end());
 
                             auto encoded = encodeKeyword(prop, encoding);
 
@@ -537,9 +536,9 @@
                 // Check if device showed up (test for file)
                 if (!fs::exists(file))
                 {
-                    std::cerr << "EEPROM " << file
-                              << " does not exist. Take failure action"
-                              << std::endl;
+                    std::cerr
+                        << "EEPROM " << file
+                        << " does not exist. Take failure action" << std::endl;
                     // If not, then take failure postAction
                     executePostFailAction(json, file);
                 }
@@ -681,8 +680,8 @@
  * @returns Map of items in extraInterface.
  */
 template <typename T>
-inventory::ObjectMap primeInventory(const nlohmann::json& jsObject,
-                                    const T& vpdMap)
+inventory::ObjectMap
+    primeInventory(const nlohmann::json& jsObject, const T& vpdMap)
 {
     inventory::ObjectMap objects;
 
@@ -1110,17 +1109,17 @@
                                 std::ostringstream busStream;
                                 for (uint16_t byte : backupValue)
                                 {
-                                    busStream << std::setfill('0')
-                                              << std::setw(2) << std::hex
-                                              << "0x" << byte << " ";
+                                    busStream
+                                        << std::setfill('0') << std::setw(2)
+                                        << std::hex << "0x" << byte << " ";
                                 }
 
                                 std::ostringstream vpdStream;
                                 for (uint16_t byte : kwdValue)
                                 {
-                                    vpdStream << std::setfill('0')
-                                              << std::setw(2) << std::hex
-                                              << "0x" << byte << " ";
+                                    vpdStream
+                                        << std::setfill('0') << std::setw(2)
+                                        << std::hex << "0x" << byte << " ";
                                 }
 
                                 // data mismatch
diff --git a/ibm_vpd_utils.cpp b/ibm_vpd_utils.cpp
index de38c6e..d015d86 100644
--- a/ibm_vpd_utils.cpp
+++ b/ibm_vpd_utils.cpp
@@ -717,16 +717,16 @@
     std::string hexString;
     std::visit(
         [&hexString](auto&& kw) {
-        std::stringstream ss;
-        std::string hexRep = "0x";
-        ss << hexRep;
-        for (auto& kwVal : kw)
-        {
-            ss << std::setfill('0') << std::setw(2) << std::hex
-               << static_cast<int>(kwVal);
-        }
-        hexString = ss.str();
-    },
+            std::stringstream ss;
+            std::string hexRep = "0x";
+            ss << hexRep;
+            for (auto& kwVal : kw)
+            {
+                ss << std::setfill('0') << std::setw(2) << std::hex
+                   << static_cast<int>(kwVal);
+            }
+            hexString = ss.str();
+        },
         kw);
     return hexString;
 }
@@ -736,18 +736,18 @@
     std::string kwString{};
     std::visit(
         [&kwString](auto&& kwVal) {
-        const auto it =
-            std::find_if(kwVal.begin(), kwVal.end(),
-                         [](const auto& kw) { return !isprint(kw); });
-        if (it != kwVal.end())
-        {
-            kwString = hexString(kwVal);
-        }
-        else
-        {
-            kwString = std::string(kwVal.begin(), kwVal.end());
-        }
-    },
+            const auto it =
+                std::find_if(kwVal.begin(), kwVal.end(),
+                             [](const auto& kw) { return !isprint(kw); });
+            if (it != kwVal.end())
+            {
+                kwString = hexString(kwVal);
+            }
+            else
+            {
+                kwString = std::string(kwVal.begin(), kwVal.end());
+            }
+        },
         kwVal);
     return kwString;
 }
@@ -1007,10 +1007,10 @@
     // TODO: How do we handle multiple chassis?
     std::string powerState{};
     auto bus = sdbusplus::bus::new_default();
-    auto properties = bus.new_method_call("xyz.openbmc_project.State.Chassis0",
-                                          "/xyz/openbmc_project/state/chassis0",
-                                          "org.freedesktop.DBus.Properties",
-                                          "Get");
+    auto properties =
+        bus.new_method_call("xyz.openbmc_project.State.Chassis0",
+                            "/xyz/openbmc_project/state/chassis0",
+                            "org.freedesktop.DBus.Properties", "Get");
     properties.append("xyz.openbmc_project.State.Chassis");
     properties.append("CurrentPowerState");
     auto result = bus.call(properties);
diff --git a/ibm_vpd_utils.hpp b/ibm_vpd_utils.hpp
index 03015d1..5f0f9e7 100644
--- a/ibm_vpd_utils.hpp
+++ b/ibm_vpd_utils.hpp
@@ -139,9 +139,9 @@
     try
     {
         auto bus = sdbusplus::bus::new_default();
-        auto properties = bus.new_method_call(service.c_str(), object.c_str(),
-                                              "org.freedesktop.DBus.Properties",
-                                              "Get");
+        auto properties =
+            bus.new_method_call(service.c_str(), object.c_str(),
+                                "org.freedesktop.DBus.Properties", "Get");
         properties.append(inf);
         properties.append(prop);
         auto result = bus.call(properties);
@@ -383,10 +383,9 @@
  *  @param[in] bindOrUnbind - either bind or unbind
  *  @returns  Command to bind or unbind the driver.
  */
-inline std::string createBindUnbindDriverCmnd(const std::string& devNameAddr,
-                                              const std::string& busType,
-                                              const std::string& driverType,
-                                              const std::string& bindOrUnbind)
+inline std::string createBindUnbindDriverCmnd(
+    const std::string& devNameAddr, const std::string& busType,
+    const std::string& driverType, const std::string& bindOrUnbind)
 {
     return ("echo " + devNameAddr + " > /sys/bus/" + busType + "/drivers/" +
             driverType + "/" + bindOrUnbind);
@@ -487,9 +486,9 @@
     try
     {
         auto bus = sdbusplus::bus::new_default();
-        auto method = bus.new_method_call(service.c_str(), object.c_str(),
-                                          "org.freedesktop.DBus.Properties",
-                                          "Set");
+        auto method =
+            bus.new_method_call(service.c_str(), object.c_str(),
+                                "org.freedesktop.DBus.Properties", "Set");
         method.append(interface);
         method.append(propertyName);
         method.append(propertyValue);
diff --git a/impl.cpp b/impl.cpp
index 1f1cb9e..4e43303 100644
--- a/impl.cpp
+++ b/impl.cpp
@@ -79,11 +79,11 @@
     int rc = eccStatus::SUCCESS;
     auto vpdPtr = vpd.cbegin();
 
-    auto l_status =
-        vpdecc_check_data(const_cast<uint8_t*>(&vpdPtr[offsets::VHDR_RECORD]),
-                          lengths::VHDR_RECORD_LENGTH,
-                          const_cast<uint8_t*>(&vpdPtr[offsets::VHDR_ECC]),
-                          lengths::VHDR_ECC_LENGTH);
+    auto l_status = vpdecc_check_data(
+        const_cast<uint8_t*>(&vpdPtr[offsets::VHDR_RECORD]),
+        lengths::VHDR_RECORD_LENGTH,
+        const_cast<uint8_t*>(&vpdPtr[offsets::VHDR_ECC]),
+        lengths::VHDR_ECC_LENGTH);
     if (l_status == VPD_ECC_CORRECTABLE_DATA)
     {
         try
diff --git a/impl.hpp b/impl.hpp
index 280ba3b..b1aa060 100644
--- a/impl.hpp
+++ b/impl.hpp
@@ -74,13 +74,12 @@
      */
     Impl(const Binary& vpdBuffer, const std::string& path,
          const std::string& vpdFilePath, uint32_t vpdStartOffset) :
-        vpd(vpdBuffer),
-        inventoryPath(path), vpdFilePath(vpdFilePath),
+        vpd(vpdBuffer), inventoryPath(path), vpdFilePath(vpdFilePath),
         vpdStartOffset(vpdStartOffset), out{}
     {
 #ifndef ManagerTest
-        vpdFileStream.exceptions(std::ifstream::badbit |
-                                 std::ifstream::failbit);
+        vpdFileStream.exceptions(
+            std::ifstream::badbit | std::ifstream::failbit);
 #endif
         try
         {
diff --git a/test/keyword_vpd_parser_test/kw_vpd_test.cpp b/test/keyword_vpd_parser_test/kw_vpd_test.cpp
index becdd56..dc05358 100644
--- a/test/keyword_vpd_parser_test/kw_vpd_test.cpp
+++ b/test/keyword_vpd_parser_test/kw_vpd_test.cpp
@@ -49,10 +49,10 @@
              0x50, 0x32, 0x2d, 0x44, 0x37, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
              0x32, 0x53, 0x53, 0x43, 0x83, 0x50, 0x32, 0x2d, 0x44, 0x38, 0x20,
              0x20, 0x20, 0x20, 0x20, 0x20, 0x32, 0x53, 0x53, 0x43}},
-        pair<std::string, Binary>{"B2",
-                                  {0x50, 0x05, 0x07, 0x60, 0x73, 0x00, 0x72,
-                                   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                                   0x01, 0x00}},
+        pair<std::string, Binary>{
+            "B2",
+            {0x50, 0x05, 0x07, 0x60, 0x73, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00,
+             0x00, 0x00, 0x00, 0x01, 0x00}},
         pair<std::string, Binary>{"MF", {0x00, 0x10}},
         pair<std::string, Binary>{"VZ", {0x30, 0x33}},
         pair<std::string, Binary>{"PN",
diff --git a/test/vpd-manager-test/reader_test.cpp b/test/vpd-manager-test/reader_test.cpp
index 54c98f0..dd576e6 100644
--- a/test/vpd-manager-test/reader_test.cpp
+++ b/test/vpd-manager-test/reader_test.cpp
@@ -152,8 +152,8 @@
 
     MockUtilCalls uCalls;
     ReaderImpl read(uCalls);
-    ListOfPaths paths = read.getFrusAtLocation(LocationCode, nodeNumber,
-                                               fruLocationCode);
+    ListOfPaths paths =
+        read.getFrusAtLocation(LocationCode, nodeNumber, fruLocationCode);
     std::string expected =
         "/xyz/openbmc_project/inventory/system/chassis/motherboard";
     EXPECT_EQ(paths.at(0), expected);
@@ -168,8 +168,8 @@
     ReaderImpl read(uCalls);
     ListOfPaths paths;
     EXPECT_ANY_THROW({
-        paths = read.getFRUsByExpandedLocationCode(locationCode,
-                                                   fruLocationCode);
+        paths =
+            read.getFRUsByExpandedLocationCode(locationCode, fruLocationCode);
     });
 
     // unused variable warning
@@ -178,8 +178,8 @@
     // length is les sthan 17 for expanded location code
     locationCode = "U9105.22A.SIMP10";
     EXPECT_ANY_THROW({
-        paths = read.getFRUsByExpandedLocationCode(locationCode,
-                                                   fruLocationCode);
+        paths =
+            read.getFRUsByExpandedLocationCode(locationCode, fruLocationCode);
     });
 
     // Invalid location code. No "."
@@ -195,8 +195,8 @@
     // unused variable warning
     (void)paths;
     EXPECT_ANY_THROW({
-        paths = read.getFRUsByExpandedLocationCode(locationCode,
-                                                   fruLocationCode);
+        paths =
+            read.getFRUsByExpandedLocationCode(locationCode, fruLocationCode);
     });
 }
 
@@ -213,8 +213,8 @@
             testing::Return("78DAPQRS")); // return a dummy value for FC keyword
 
     ReaderImpl read(uCalls);
-    ListOfPaths paths = read.getFRUsByExpandedLocationCode(validLocationCode,
-                                                           fruLocationCode);
+    ListOfPaths paths =
+        read.getFRUsByExpandedLocationCode(validLocationCode, fruLocationCode);
 
     std::string expected =
         "/xyz/openbmc_project/inventory/system/chassis/motherboard";
@@ -241,8 +241,8 @@
             testing::Return("9105PQRS")); // return a dummy value for TM keyword
 
     ReaderImpl read(uCalls);
-    ListOfPaths paths = read.getFRUsByExpandedLocationCode(validLocationCode,
-                                                           fruLocationCode);
+    ListOfPaths paths =
+        read.getFRUsByExpandedLocationCode(validLocationCode, fruLocationCode);
 
     std::string expected = "/xyz/openbmc_project/inventory/system";
     EXPECT_EQ(paths.at(0), expected);
diff --git a/vpd-manager/bios_handler.cpp b/vpd-manager/bios_handler.cpp
index f8c6d73..14e1095 100644
--- a/vpd-manager/bios_handler.cpp
+++ b/vpd-manager/bios_handler.cpp
@@ -34,23 +34,24 @@
             sdbusplus::bus::match::rules::nameOwnerChanged(
                 "xyz.openbmc_project.PLDM"),
             [this](sdbusplus::message_t& msg) {
-        if (msg.is_method_error())
-        {
-            std::cerr << "Error in reading name owner signal " << std::endl;
-            return;
-        }
-        std::string name;
-        std::string newOwner;
-        std::string oldOwner;
+                if (msg.is_method_error())
+                {
+                    std::cerr
+                        << "Error in reading name owner signal " << std::endl;
+                    return;
+                }
+                std::string name;
+                std::string newOwner;
+                std::string oldOwner;
 
-        msg.read(name, oldOwner, newOwner);
-        if (newOwner != "" && name == "xyz.openbmc_project.PLDM")
-        {
-            this->restoreBIOSAttribs();
-            // We don't need the match anymore
-            nameOwnerMatch.reset();
-        }
-    });
+                msg.read(name, oldOwner, newOwner);
+                if (newOwner != "" && name == "xyz.openbmc_project.PLDM")
+                {
+                    this->restoreBIOSAttribs();
+                    // We don't need the match anymore
+                    nameOwnerMatch.reset();
+                }
+            });
     // Check if PLDM is already running, if it is, we can go ahead and attempt
     // to sync BIOS attributes (since PLDM would have initialized them by the
     // time it acquires a bus name).
@@ -550,8 +551,8 @@
     }
 
     // Need to write?
-    std::string toWrite = (createDefaultLpar.at(0) & 0x02) ? "Enabled"
-                                                           : "Disabled";
+    std::string toWrite =
+        (createDefaultLpar.at(0) & 0x02) ? "Enabled" : "Disabled";
     if (createDefaultLparInBIOS == toWrite)
     {
         std::cout << "Skip Create default LPAR BIOS write, value is already: "
@@ -623,8 +624,8 @@
     // VPD keywords with data taken from the BIOS.
     auto fcoInVPD = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS", "RG");
     auto ammInVPD = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL", "D0");
-    auto keepAndClearInVPD = readBusProperty(SYSTEM_OBJECT,
-                                             "com.ibm.ipzvpd.UTIL", "D1");
+    auto keepAndClearInVPD =
+        readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL", "D1");
     auto fcoInBIOS = readBIOSFCO();
     auto ammInBIOS = readBIOSAMM();
     auto keepAndClearInBIOS = readBIOSKeepAndClear();
@@ -655,13 +656,13 @@
     saveKeepAndClearToBIOS(keepAndClearInVPD, keepAndClearInBIOS);
     // Have to read D1 again because two attributes are stored in the same
     // keyword.
-    auto createDefaultLparInVPD = readBusProperty(SYSTEM_OBJECT,
-                                                  "com.ibm.ipzvpd.UTIL", "D1");
+    auto createDefaultLparInVPD =
+        readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL", "D1");
     saveCreateDefaultLparToBIOS(createDefaultLparInVPD,
                                 createDefaultLparInBIOS);
 
-    auto clearNVRAMInVPD = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL",
-                                           "D1");
+    auto clearNVRAMInVPD =
+        readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.UTIL", "D1");
     saveClearNVRAMToBIOS(clearNVRAMInVPD, clearNVRAMInBIOS);
 
     // Start listener now that we have done the restore
diff --git a/vpd-manager/bios_handler.hpp b/vpd-manager/bios_handler.hpp
index ef4cfa4..adee3c7 100644
--- a/vpd-manager/bios_handler.hpp
+++ b/vpd-manager/bios_handler.hpp
@@ -42,9 +42,7 @@
     ~BiosHandler() = default;
 
     BiosHandler(std::shared_ptr<sdbusplus::asio::connection>& conn,
-                Manager& manager) :
-        conn(conn),
-        manager(manager)
+                Manager& manager) : conn(conn), manager(manager)
     {
         checkAndListenPLDMService();
     }
diff --git a/vpd-manager/editor_impl.cpp b/vpd-manager/editor_impl.cpp
index 727afac..c24cc0f 100644
--- a/vpd-manager/editor_impl.cpp
+++ b/vpd-manager/editor_impl.cpp
@@ -65,10 +65,10 @@
         else
         {
             // Jump the record
-            std::advance(iterator, lengths::RECORD_NAME + sizeof(RecordType) +
-                                       sizeof(RecordOffset) +
-                                       sizeof(RecordLength) +
-                                       sizeof(ECCOffset) + sizeof(ECCLength));
+            std::advance(iterator,
+                         lengths::RECORD_NAME + sizeof(RecordType) +
+                             sizeof(RecordOffset) + sizeof(RecordLength) +
+                             sizeof(ECCOffset) + sizeof(ECCLength));
         }
     }
     // imples the record was not found
@@ -311,10 +311,9 @@
 }
 
 template <typename T>
-void EditorImpl::makeDbusCall(const std::string& object,
-                              const std::string& interface,
-                              const std::string& property,
-                              const std::variant<T>& data)
+void EditorImpl::makeDbusCall(
+    const std::string& object, const std::string& interface,
+    const std::string& property, const std::variant<T>& data)
 {
     auto bus = sdbusplus::bus::new_default();
     auto properties =
@@ -470,17 +469,17 @@
 
     if (locationCodeType == "fcs")
     {
-        propertyFCorTM = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN",
-                                         "FC");
-        propertySE = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN",
-                                     "SE");
+        propertyFCorTM =
+            readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN", "FC");
+        propertySE =
+            readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VCEN", "SE");
     }
     else if (locationCodeType == "mts")
     {
-        propertyFCorTM = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS",
-                                         "TM");
-        propertySE = readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS",
-                                     "SE");
+        propertyFCorTM =
+            readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS", "TM");
+        propertySE =
+            readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS", "SE");
     }
 
     const nlohmann::json& groupFRUS =
@@ -602,15 +601,15 @@
         enableRebootGuard();
 
         Binary completeVPDFile;
-        vpdFileStream.exceptions(std::ifstream::badbit |
-                                 std::ifstream::failbit);
+        vpdFileStream.exceptions(
+            std::ifstream::badbit | std::ifstream::failbit);
         try
         {
             vpdFileStream.open(vpdFilePath,
                                std::ios::in | std::ios::out | std::ios::binary);
 
-            auto vpdFileSize = std::min(std::filesystem::file_size(vpdFilePath),
-                                        MAX_VPD_SIZE);
+            auto vpdFileSize =
+                std::min(std::filesystem::file_size(vpdFilePath), MAX_VPD_SIZE);
             if (vpdFileSize == 0)
             {
                 std::cerr << "File size is 0 for " << vpdFilePath << std::endl;
diff --git a/vpd-manager/editor_impl.hpp b/vpd-manager/editor_impl.hpp
index 98a2fa1..cf0ef2b 100644
--- a/vpd-manager/editor_impl.hpp
+++ b/vpd-manager/editor_impl.hpp
@@ -37,8 +37,7 @@
      */
     EditorImpl(const std::string& record, const std::string& kwd,
                Binary&& vpd) :
-        startOffset(0),
-        thisRecord(record, kwd), vpdFile(std::move(vpd))
+        startOffset(0), thisRecord(record, kwd), vpdFile(std::move(vpd))
     {}
 
     /** @brief Construct EditorImpl class
@@ -52,9 +51,8 @@
     EditorImpl(const inventory::Path& path, const nlohmann::json& json,
                const std::string& record, const std::string& kwd,
                const sdbusplus::message::object_path& inventoryPath) :
-        vpdFilePath(path),
-        objPath(inventoryPath), startOffset(0), jsonFile(json),
-        thisRecord(record, kwd)
+        vpdFilePath(path), objPath(inventoryPath), startOffset(0),
+        jsonFile(json), thisRecord(record, kwd)
     {}
 
     /** @brief Construct EditorImpl class
@@ -66,8 +64,7 @@
      */
     EditorImpl(const inventory::Path& path, const nlohmann::json& json,
                const std::string& record, const std::string& kwd) :
-        vpdFilePath(path),
-        jsonFile(json), thisRecord(record, kwd)
+        vpdFilePath(path), jsonFile(json), thisRecord(record, kwd)
     {}
 
     /**
diff --git a/vpd-manager/gpioMonitor.cpp b/vpd-manager/gpioMonitor.cpp
index 90374d2..3196fee 100644
--- a/vpd-manager/gpioMonitor.cpp
+++ b/vpd-manager/gpioMonitor.cpp
@@ -174,8 +174,8 @@
     {
         toggleGpio();
     }
-    timer->expires_at(std::chrono::steady_clock::now() +
-                      std::chrono::seconds(5));
+    timer->expires_at(
+        std::chrono::steady_clock::now() + std::chrono::seconds(5));
     timer->async_wait(boost::bind(&GpioEventHandler::handleTimerExpiry, this,
                                   boost::asio::placeholders::error, timer));
 }
diff --git a/vpd-manager/gpioMonitor.hpp b/vpd-manager/gpioMonitor.hpp
index 790373b..5f34336 100644
--- a/vpd-manager/gpioMonitor.hpp
+++ b/vpd-manager/gpioMonitor.hpp
@@ -31,10 +31,9 @@
                      Byte& outValue, std::string& devAddr, std::string& driver,
                      std::string& bus, std::string& objPath,
                      std::shared_ptr<boost::asio::io_context>& ioCon) :
-        presencePin(presPin),
-        presenceValue(presValue), outputPin(outPin), outputValue(outValue),
-        devNameAddr(devAddr), driverType(driver), busType(bus),
-        objectPath(objPath)
+        presencePin(presPin), presenceValue(presValue), outputPin(outPin),
+        outputValue(outValue), devNameAddr(devAddr), driverType(driver),
+        busType(bus), objectPath(objPath)
     {
         doEventAndTimerSetup(ioCon);
     }
@@ -120,8 +119,7 @@
     GpioMonitor& operator=(GpioMonitor&&) = delete;
 
     GpioMonitor(nlohmann::json& js,
-                std::shared_ptr<boost::asio::io_context>& ioCon) :
-        jsonFile(js)
+                std::shared_ptr<boost::asio::io_context>& ioCon) : jsonFile(js)
     {
         initGpioInfos(ioCon);
     }
diff --git a/vpd-manager/manager.cpp b/vpd-manager/manager.cpp
index 072fe99..62220db 100644
--- a/vpd-manager/manager.cpp
+++ b/vpd-manager/manager.cpp
@@ -38,49 +38,50 @@
 Manager::Manager(std::shared_ptr<boost::asio::io_context>& ioCon,
                  std::shared_ptr<sdbusplus::asio::dbus_interface>& iFace,
                  std::shared_ptr<sdbusplus::asio::connection>& conn) :
-    ioContext(ioCon),
-    interface(iFace), conn(conn)
+    ioContext(ioCon), interface(iFace), conn(conn)
 {
     interface->register_method(
         "WriteKeyword",
         [this](const sdbusplus::message::object_path& path,
                const std::string& recordName, const std::string& keyword,
                const Binary& value) {
-        this->writeKeyword(path, recordName, keyword, value);
-    });
+            this->writeKeyword(path, recordName, keyword, value);
+        });
 
     interface->register_method(
         "GetFRUsByUnexpandedLocationCode",
         [this](const std::string& locationCode,
                const uint16_t nodeNumber) -> inventory::ListOfPaths {
-        return this->getFRUsByUnexpandedLocationCode(locationCode, nodeNumber);
-    });
+            return this->getFRUsByUnexpandedLocationCode(locationCode,
+                                                         nodeNumber);
+        });
 
     interface->register_method(
         "GetFRUsByExpandedLocationCode",
         [this](const std::string& locationCode) -> inventory::ListOfPaths {
-        return this->getFRUsByExpandedLocationCode(locationCode);
-    });
+            return this->getFRUsByExpandedLocationCode(locationCode);
+        });
 
     interface->register_method(
         "GetExpandedLocationCode",
         [this](const std::string& locationCode,
                const uint16_t nodeNumber) -> std::string {
-        return this->getExpandedLocationCode(locationCode, nodeNumber);
-    });
+            return this->getExpandedLocationCode(locationCode, nodeNumber);
+        });
 
-    interface->register_method("PerformVPDRecollection",
-                               [this]() { this->performVPDRecollection(); });
+    interface->register_method("PerformVPDRecollection", [this]() {
+        this->performVPDRecollection();
+    });
 
     interface->register_method(
         "deleteFRUVPD", [this](const sdbusplus::message::object_path& path) {
-        this->deleteFRUVPD(path);
-    });
+            this->deleteFRUVPD(path);
+        });
 
     interface->register_method(
         "CollectFRUVPD", [this](const sdbusplus::message::object_path& path) {
-        this->collectFRUVPD(path);
-    });
+            this->collectFRUVPD(path);
+        });
 
     sd_bus_default(&sdBus);
     initManager();
@@ -408,11 +409,11 @@
         if (itr != svpdKwdMap.end())
         {
             auto systemKwdInfoList = itr->second;
-            const auto& itrToKwd = find_if(systemKwdInfoList.begin(),
-                                           systemKwdInfoList.end(),
-                                           [&keyword](const auto& kwdInfo) {
-                return (keyword == std::get<0>(kwdInfo));
-            });
+            const auto& itrToKwd =
+                find_if(systemKwdInfoList.begin(), systemKwdInfoList.end(),
+                        [&keyword](const auto& kwdInfo) {
+                            return (keyword == std::get<0>(kwdInfo));
+                        });
 
             if (itrToKwd != systemKwdInfoList.end())
             {
@@ -525,9 +526,8 @@
     }
 }
 
-ListOfPaths
-    Manager::getFRUsByUnexpandedLocationCode(const LocationCode& locationCode,
-                                             const NodeNumber nodeNumber)
+ListOfPaths Manager::getFRUsByUnexpandedLocationCode(
+    const LocationCode& locationCode, const NodeNumber nodeNumber)
 {
     ReaderImpl read;
     return read.getFrusAtLocation(locationCode, nodeNumber, fruLocationCode);
@@ -790,14 +790,14 @@
             string busNum = deviceAddress.substr(0, pos);
             deviceAddress = "0x" + deviceAddress.substr(pos + 1, string::npos);
 
-            string deleteDevice = "echo" + deviceAddress + " > /sys/bus/" +
-                                  busType + "/devices/" + busType + "-" +
-                                  busNum + "/delete_device";
+            string deleteDevice =
+                "echo" + deviceAddress + " > /sys/bus/" + busType +
+                "/devices/" + busType + "-" + busNum + "/delete_device";
             executeCmd(deleteDevice);
 
-            string addDevice = "echo" + driverType + " " + deviceAddress +
-                               " > /sys/bus/" + busType + "/devices/" +
-                               busType + "-" + busNum + "/new_device";
+            string addDevice =
+                "echo" + driverType + " " + deviceAddress + " > /sys/bus/" +
+                busType + "/devices/" + busType + "-" + busNum + "/new_device";
             executeCmd(addDevice);
         }
         else
@@ -862,8 +862,8 @@
         // check if we have cxp-port populated for the given object path.
         std::vector<std::string> interfaceList{
             "xyz.openbmc_project.State.Decorator.OperationalStatus"};
-        MapperResponse subTree = getObjectSubtreeForInterfaces(path, 0,
-                                                               interfaceList);
+        MapperResponse subTree =
+            getObjectSubtreeForInterfaces(path, 0, interfaceList);
 
         if (subTree.size() != 0)
         {
diff --git a/vpd-manager/manager.hpp b/vpd-manager/manager.hpp
index 4ee376f..ae278ac 100644
--- a/vpd-manager/manager.hpp
+++ b/vpd-manager/manager.hpp
@@ -75,9 +75,8 @@
      *  @return inventoryList[std::vector<sdbusplus::message::object_path>] -
      *  List of all the FRUs D-Bus object paths for the given location code.
      */
-    inventory::ListOfPaths
-        getFRUsByUnexpandedLocationCode(const std::string& locationCode,
-                                        const uint16_t nodeNumber);
+    inventory::ListOfPaths getFRUsByUnexpandedLocationCode(
+        const std::string& locationCode, const uint16_t nodeNumber);
 
     /** @brief Implementation for GetFRUsByExpandedLocationCode
      *  A method to get list of FRU D-BUS object paths for a given expanded
diff --git a/vpd-manager/reader_impl.cpp b/vpd-manager/reader_impl.cpp
index 92f6a91..e4f2d8b 100644
--- a/vpd-manager/reader_impl.cpp
+++ b/vpd-manager/reader_impl.cpp
@@ -80,10 +80,9 @@
     return expandedLocationCode;
 }
 
-ListOfPaths
-    ReaderImpl::getFrusAtLocation(const LocationCode& locationCode,
-                                  const NodeNumber& nodeNumber,
-                                  const LocationCodeMap& frusLocationCode) const
+ListOfPaths ReaderImpl::getFrusAtLocation(
+    const LocationCode& locationCode, const NodeNumber& nodeNumber,
+    const LocationCodeMap& frusLocationCode) const
 {
     // unused at this moment, to avoid compilation warning
     (void)nodeNumber;
@@ -113,8 +112,8 @@
     for_each(range.first, range.second,
              [&inventoryPaths](
                  const inventory::LocationCodeMap::value_type& mappedItem) {
-        inventoryPaths.push_back(INVENTORY_PATH + mappedItem.second);
-    });
+                 inventoryPaths.push_back(INVENTORY_PATH + mappedItem.second);
+             });
     return inventoryPaths;
 }
 
@@ -189,8 +188,8 @@
     {
         std::string tm{};
         // read TM kwd value
-        tm = utilObj.readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS",
-                                     "TM");
+        tm =
+            utilObj.readBusProperty(SYSTEM_OBJECT, "com.ibm.ipzvpd.VSYS", "TM");
         ;
 
         // check if the substr matches to TM kwd
diff --git a/vpd-parser/ipz_parser.hpp b/vpd-parser/ipz_parser.hpp
index 1b1f034..c4a3e26 100644
--- a/vpd-parser/ipz_parser.hpp
+++ b/vpd-parser/ipz_parser.hpp
@@ -38,8 +38,7 @@
      */
     IpzVpdParser(const Binary& VpdVector, const std::string& path,
                  const std::string& vpdFilePath, uint32_t vpdStartOffset) :
-        vpd(VpdVector),
-        inventoryPath(path), vpdFilePath(vpdFilePath),
+        vpd(VpdVector), inventoryPath(path), vpdFilePath(vpdFilePath),
         vpdStartOffset(vpdStartOffset)
     {}
 
diff --git a/vpd-parser/memory_vpd_parser.cpp b/vpd-parser/memory_vpd_parser.cpp
index c141da9..4a0ac7c 100644
--- a/vpd-parser/memory_vpd_parser.cpp
+++ b/vpd-parser/memory_vpd_parser.cpp
@@ -107,8 +107,8 @@
     }
     else
     {
-        l_DiePerPackage = pow(constants::VALUE_2,
-                              (l_ByteValue - constants::VALUE_1));
+        l_DiePerPackage =
+            pow(constants::VALUE_2, (l_ByteValue - constants::VALUE_1));
     }
     return l_DiePerPackage;
 }
@@ -143,13 +143,14 @@
                   ? constants::VALUE_1
                   : constants::VALUE_0));
 
-        uint8_t l_channelsPerDdimm = (((iterator[constants::SPD_BYTE_235] &
-                                        constants::MASK_BYTE_BITS_6) >>
-                                       constants::VALUE_6) +
-                                      ((iterator[constants::SPD_BYTE_235] &
-                                        constants::MASK_BYTE_BITS_7) >>
-                                       constants::VALUE_7)) *
-                                     l_channelsPerPhy;
+        uint8_t l_channelsPerDdimm =
+            (((iterator[constants::SPD_BYTE_235] &
+               constants::MASK_BYTE_BITS_6) >>
+              constants::VALUE_6) +
+             ((iterator[constants::SPD_BYTE_235] &
+               constants::MASK_BYTE_BITS_7) >>
+              constants::VALUE_7)) *
+            l_channelsPerPhy;
 
         if (!checkValidValue(iterator[constants::SPD_BYTE_235] &
                                  constants::MASK_BYTE_BITS_012,
@@ -167,10 +168,10 @@
                 ? PRIMARY_BUS_WIDTH_32_BITS
                 : PRIMARY_BUS_WIDTH_UNUSED;
 
-        if (!checkValidValue(iterator[constants::SPD_BYTE_4] &
-                                 constants::MASK_BYTE_BITS_567,
-                             constants::SHIFT_BITS_5, constants::VALUE_0,
-                             constants::VALUE_5))
+        if (!checkValidValue(
+                iterator[constants::SPD_BYTE_4] & constants::MASK_BYTE_BITS_567,
+                constants::SHIFT_BITS_5, constants::VALUE_0,
+                constants::VALUE_5))
         {
             std::cerr
                 << "Capacity calculation failed for die per package. DDIMM "
@@ -231,20 +232,20 @@
                                    constants::VALUE_6));
 #endif
 
-        if (!checkValidValue(iterator[constants::SPD_BYTE_6] &
-                                 constants::MASK_BYTE_BITS_567,
-                             constants::SHIFT_BITS_5, constants::VALUE_0,
-                             constants::VALUE_3))
+        if (!checkValidValue(
+                iterator[constants::SPD_BYTE_6] & constants::MASK_BYTE_BITS_567,
+                constants::SHIFT_BITS_5, constants::VALUE_0,
+                constants::VALUE_3))
         {
             std::cout
                 << "Capacity calculation failed for dram width DDIMM Byte 6 value ["
                 << iterator[constants::SPD_BYTE_6] << "]";
             break;
         }
-        uint8_t l_dramWidth = VALUE_4 *
-                              (VALUE_1 << ((iterator[constants::SPD_BYTE_6] &
-                                            constants::MASK_BYTE_BITS_567) >>
-                                           constants::VALUE_5));
+        uint8_t l_dramWidth =
+            VALUE_4 * (VALUE_1 << ((iterator[constants::SPD_BYTE_6] &
+                                    constants::MASK_BYTE_BITS_567) >>
+                                   constants::VALUE_5));
 
         dimmSize = (l_channelsPerDdimm * l_busWidthPerChannel *
                     l_diePerPackage * l_densityPerDie * l_ranksPerChannel) /
diff --git a/vpd_tool.cpp b/vpd_tool.cpp
index 911ce7f..d23fe7f 100644
--- a/vpd_tool.cpp
+++ b/vpd_tool.cpp
@@ -24,10 +24,10 @@
     string val{};
     uint32_t offset = 0;
 
-    auto object = app.add_option("--object, -O", objectPath,
-                                 "Enter the Object Path");
-    auto record = app.add_option("--record, -R", recordName,
-                                 "Enter the Record Name");
+    auto object =
+        app.add_option("--object, -O", objectPath, "Enter the Object Path");
+    auto record =
+        app.add_option("--record, -R", recordName, "Enter the Record Name");
     auto kw = app.add_option("--keyword, -K", keyword, "Enter the Keyword");
     auto valOption = app.add_option(
         "--value, -V", val,
@@ -92,9 +92,9 @@
         "--fixSystemVPD", "Use this option to interactively fix critical "
                           "system VPD keywords {vpd-tool-exe --fixSystemVPD}");
 
-    auto mfgClean = app.add_flag("--mfgClean",
-                                 "Flag to clean and reset specific keywords "
-                                 "on system VPD to its default value.");
+    auto mfgClean =
+        app.add_flag("--mfgClean", "Flag to clean and reset specific keywords "
+                                   "on system VPD to its default value.");
 
     auto confirm =
         app.add_flag("--yes", "Using this flag with --mfgClean option, assumes "
diff --git a/vpd_tool_impl.cpp b/vpd_tool_impl.cpp
index 885cd5e..30f7294 100644
--- a/vpd_tool_impl.cpp
+++ b/vpd_tool_impl.cpp
@@ -118,8 +118,8 @@
 
     uint32_t vpdStartOffset = 0;
     vpdVector = getVpdDataInVector(js, vpdPath);
-    ParserInterface* parser = ParserFactory::getParser(vpdVector, invPath,
-                                                       vpdPath, vpdStartOffset);
+    ParserInterface* parser =
+        ParserFactory::getParser(vpdVector, invPath, vpdPath, vpdStartOffset);
     auto parseResult = parser->parse();
     ParserFactory::freeParser(parser);
 
@@ -129,8 +129,8 @@
     }
     else
     {
-        std::string err = vpdPath +
-                          " is not of type IPZ VPD. Unable to parse the VPD.";
+        std::string err =
+            vpdPath + " is not of type IPZ VPD. Unable to parse the VPD.";
         throw std::runtime_error(err);
     }
 }
@@ -552,8 +552,8 @@
     }
 
     auto bus = sdbusplus::bus::new_default();
-    auto properties = bus.new_method_call(BUSNAME, OBJPATH, IFACE,
-                                          "WriteKeyword");
+    auto properties =
+        bus.new_method_call(BUSNAME, OBJPATH, IFACE, "WriteKeyword");
     properties.append(static_cast<sdbusplus::message::object_path>(fruPath));
     properties.append(recordName);
     properties.append(keyword);
@@ -1332,9 +1332,9 @@
                 backupValStr = backupValue;
             }
 
-            recKwData.push_back(make_tuple(++num, primaryRecord, primaryKeyword,
-                                           backupValStr, primaryValStr,
-                                           mismatch));
+            recKwData.push_back(
+                make_tuple(++num, primaryRecord, primaryKeyword, backupValStr,
+                           primaryValStr, mismatch));
 
             std::string splitLine(191, '-');
             cout << left << setw(6) << static_cast<int>(num) << left << setw(8)
diff --git a/vpd_tool_impl.hpp b/vpd_tool_impl.hpp
index 18070f8..47a555f 100644
--- a/vpd_tool_impl.hpp
+++ b/vpd_tool_impl.hpp
@@ -316,8 +316,7 @@
 
     VpdTool(const std::string&& fru, const std::string&& recName,
             const std::string&& kw, const std::string&& val) :
-        fruPath(std::move(fru)),
-        recordName(std::move(recName)), keyword(std::move(kw)),
-        value(std::move(val))
+        fruPath(std::move(fru)), recordName(std::move(recName)),
+        keyword(std::move(kw)), value(std::move(val))
     {}
 };
