clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I4530f5b9df4f5898e26a2eef7efcf82e9728197f
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index 52ac0a1..d92a3f1 100644
--- a/.clang-format
+++ b/.clang-format
@@ -6,12 +6,14 @@
 AlignConsecutiveAssignments: false
 AlignConsecutiveDeclarations: false
 AlignEscapedNewlines: Right
-AlignOperands:   true
-AlignTrailingComments: true
+AlignOperands:  Align
+AlignTrailingComments:
+  Kind: Always
+  OverEmptyLines: 1
 AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
+AllowShortBlocksOnASingleLine: Empty
 AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
+AllowShortFunctionsOnASingleLine: Empty
 AllowShortIfStatementsOnASingleLine: false
 AllowShortLoopsOnASingleLine: false
 AlwaysBreakAfterReturnType: None
@@ -36,12 +38,13 @@
   SplitEmptyFunction:   false
   SplitEmptyRecord:     false
   SplitEmptyNamespace:  false
+BreakAfterAttributes: Never
 BreakBeforeBinaryOperators: None
 BreakBeforeBraces: Custom
 BreakBeforeTernaryOperators: true
 BreakConstructorInitializers: AfterColon
 BreakInheritanceList: AfterColon
-BreakStringLiterals: true
+BreakStringLiterals: false
 ColumnLimit:     80
 CommentPragmas:  '^ IWYU pragma:'
 CompactNamespaces: false
@@ -49,6 +52,7 @@
 ConstructorInitializerIndentWidth: 4
 ContinuationIndentWidth: 4
 Cpp11BracedListStyle: true
+DeriveLineEnding: false
 DerivePointerAlignment: false
 PointerAlignment: Left
 DisableFormat:   false
@@ -74,9 +78,13 @@
   - Regex:           '.*'
     Priority:        6
 IndentCaseLabels: true
+IndentRequiresClause: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
-KeepEmptyLinesAtTheStartOfBlocks: true
+InsertNewlineAtEOF: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
 MaxEmptyLinesToKeep: 1
@@ -84,13 +92,19 @@
 ObjCBlockIndentWidth: 2
 ObjCSpaceAfterProperty: false
 ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 25
 PenaltyBreakBeforeFirstCallParameter: 19
 PenaltyBreakComment: 300
 PenaltyBreakFirstLessLess: 120
 PenaltyBreakString: 1000
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+QualifierAlignment: Left
+ReferenceAlignment: Left
 ReflowComments:  true
+RequiresClausePosition: OwnLine
+RequiresExpressionIndentation: Keyword
 SortIncludes:    true
 SortUsingDeclarations: true
 SpaceAfterCStyleCast: false
diff --git a/activation.cpp b/activation.cpp
index b873702..28f6bcc 100644
--- a/activation.cpp
+++ b/activation.cpp
@@ -175,7 +175,6 @@
     }
     else
     {
-
         auto method = bus.new_method_call(service.c_str(), applyTimeObjPath,
                                           dbusPropIntf, "Get");
         method.append(applyTimeIntf, applyTimeProp);
@@ -270,8 +269,8 @@
 
 bool Activation::fieldModeEnabled()
 {
-    auto fieldModeSvc =
-        utils::getService(bus, FIELDMODE_PATH, FIELDMODE_INTERFACE);
+    auto fieldModeSvc = utils::getService(bus, FIELDMODE_PATH,
+                                          FIELDMODE_INTERFACE);
 
     auto method = bus.new_method_call(fieldModeSvc.c_str(), FIELDMODE_PATH,
                                       "org.freedesktop.DBus.Properties", "Get");
diff --git a/functions.cpp b/functions.cpp
index ab97e0a..0ee20ec 100644
--- a/functions.cpp
+++ b/functions.cpp
@@ -348,8 +348,8 @@
 
         // Create symlinks from the hostfw elements to their corresponding
         // lid files if they don't exist
-        auto elementFilePath =
-            std::filesystem::path("/media/hostfw/running") / a.first;
+        auto elementFilePath = std::filesystem::path("/media/hostfw/running") /
+                               a.first;
         if (!std::filesystem::exists(elementFilePath))
         {
             std::error_code ec;
@@ -640,24 +640,24 @@
                 "xyz.openbmc_project.EntityManager"),
         [pExtensionMap, pHostFirmwareDirectory, pErrorCallback,
          &loop](auto& message) {
-            // bind the extension map, host firmware directory, and error
-            // callback to the maybeMakeLinks function.
-            auto maybeMakeLinksWithArgsBound =
-                std::bind(maybeMakeLinks, std::cref(*pExtensionMap),
-                          std::cref(*pHostFirmwareDirectory),
-                          std::placeholders::_1, std::cref(*pErrorCallback));
+        // bind the extension map, host firmware directory, and error
+        // callback to the maybeMakeLinks function.
+        auto maybeMakeLinksWithArgsBound =
+            std::bind(maybeMakeLinks, std::cref(*pExtensionMap),
+                      std::cref(*pHostFirmwareDirectory), std::placeholders::_1,
+                      std::cref(*pErrorCallback));
 
-            // if the InterfacesAdded message contains an an instance of
-            // xyz.openbmc_project.Configuration.IBMCompatibleSystem, check to
-            // see if links are necessary on this system and if so, create
-            // them.
-            if (maybeCallMessage(message, maybeMakeLinksWithArgsBound))
-            {
-                // The IBMCompatibleSystem interface was found and the links
-                // were created if applicable.  Instruct the event loop /
-                // subcommand to exit.
-                loop.exit(0);
-            }
+        // if the InterfacesAdded message contains an an instance of
+        // xyz.openbmc_project.Configuration.IBMCompatibleSystem, check to
+        // see if links are necessary on this system and if so, create
+        // them.
+        if (maybeCallMessage(message, maybeMakeLinksWithArgsBound))
+        {
+            // The IBMCompatibleSystem interface was found and the links
+            // were created if applicable.  Instruct the event loop /
+            // subcommand to exit.
+            loop.exit(0);
+        }
         });
 
     // now that we'll get a callback in the event of an InterfacesAdded signal
@@ -757,10 +757,10 @@
                 "xyz.openbmc_project.EntityManager"),
         [pldmPath, pExtensionMap, pElementsJsonFilePath,
          maybeSetAttrWithArgsBound, &loop](auto& message) {
-            if (maybeCallMessage(message, maybeSetAttrWithArgsBound))
-            {
-                loop.exit(0);
-            }
+        if (maybeCallMessage(message, maybeSetAttrWithArgsBound))
+        {
+            loop.exit(0);
+        }
         }));
 
     // The BIOS attribute table can only be updated if PLDM is running because
@@ -773,29 +773,28 @@
                 "xyz.openbmc_project.PLDM"),
         [pExtensionMap, pElementsJsonFilePath, maybeSetAttrWithArgsBound,
          &loop](auto& message) {
-            std::string name;
-            std::string oldOwner;
-            std::string newOwner;
-            message.read(name, oldOwner, newOwner);
+        std::string name;
+        std::string oldOwner;
+        std::string newOwner;
+        message.read(name, oldOwner, newOwner);
 
-            if (newOwner.empty())
-            {
-                return;
-            }
+        if (newOwner.empty())
+        {
+            return;
+        }
 
-            auto bus = sdbusplus::bus::new_default();
-            InterfacesPropertiesMap interfacesAndProperties;
-            auto objects = getManagedObjects(bus, entityManagerServiceName,
-                                             "/xyz/openbmc_project/inventory");
-            for (const auto& pair : objects)
+        auto bus = sdbusplus::bus::new_default();
+        InterfacesPropertiesMap interfacesAndProperties;
+        auto objects = getManagedObjects(bus, entityManagerServiceName,
+                                         "/xyz/openbmc_project/inventory");
+        for (const auto& pair : objects)
+        {
+            std::tie(std::ignore, interfacesAndProperties) = pair;
+            if (maybeCall(interfacesAndProperties, maybeSetAttrWithArgsBound))
             {
-                std::tie(std::ignore, interfacesAndProperties) = pair;
-                if (maybeCall(interfacesAndProperties,
-                              maybeSetAttrWithArgsBound))
-                {
-                    loop.exit(0);
-                }
+                loop.exit(0);
             }
+        }
         }));
 
     InterfacesPropertiesMap interfacesAndProperties;
diff --git a/image_verify.cpp b/image_verify.cpp
index 917128c..a599287 100644
--- a/image_verify.cpp
+++ b/image_verify.cpp
@@ -167,8 +167,8 @@
     for (const auto& keyType : keyTypes)
     {
         auto keyHashPair = getKeyHashFileNames(keyType);
-        auto keyValues =
-            Version::getValue(keyHashPair.first, {{hashFunctionTag, " "}});
+        auto keyValues = Version::getValue(keyHashPair.first,
+                                           {{hashFunctionTag, " "}});
         auto hashFunc = keyValues.at(hashFunctionTag);
 
         try
@@ -200,7 +200,6 @@
                            const std::filesystem::path& publicKey,
                            const std::string& hashFunc)
 {
-
     // Check existence of the files in the system.
     if (!(std::filesystem::exists(file) && std::filesystem::exists(sigFile)))
     {
@@ -301,7 +300,6 @@
 
 CustomMap Signature::mapFile(const std::filesystem::path& path, size_t size)
 {
-
     CustomFd fd(open(path.c_str(), O_RDONLY));
 
     return CustomMap(mmap(nullptr, size, PROT_READ, MAP_PRIVATE, fd(), 0),
diff --git a/image_verify.hpp b/image_verify.hpp
index 0d04815..efd3873 100644
--- a/image_verify.hpp
+++ b/image_verify.hpp
@@ -47,8 +47,7 @@
      *
      *  @param[in] fd - File descriptor
      */
-    explicit CustomFd(int fd) : fd(fd)
-    {}
+    explicit CustomFd(int fd) : fd(fd) {}
 
     ~CustomFd()
     {
@@ -93,8 +92,7 @@
      *  @param[in]  addr - Starting address of the map
      *  @param[in]  length - length of the map
      */
-    CustomMap(void* addr, size_t length) : addr(addr), length(length)
-    {}
+    CustomMap(void* addr, size_t length) : addr(addr), length(length) {}
 
     ~CustomMap()
     {
diff --git a/item_updater.cpp b/item_updater.cpp
index 3173481..5b27534 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -114,8 +114,8 @@
             path, versionId, extendedVersion, activationState, associations);
         activations.emplace(versionId, std::move(activation));
 
-        auto versionPtr =
-            createVersionObject(path, versionId, version, purpose, filePath);
+        auto versionPtr = createVersionObject(path, versionId, version, purpose,
+                                              filePath);
         versions.emplace(versionId, std::move(versionPtr));
     }
     return;
diff --git a/item_updater.hpp b/item_updater.hpp
index c8b414d..0aa3a5d 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -53,8 +53,7 @@
         bus(bus), path(path)
     {}
 
-    virtual ~GardReset()
-    {}
+    virtual ~GardReset() {}
 
     /**
      * @brief GARD factory reset - clears the PNOR GARD partition.
diff --git a/item_updater_main.cpp b/item_updater_main.cpp
index a774fd2..23f71b5 100644
--- a/item_updater_main.cpp
+++ b/item_updater_main.cpp
@@ -90,16 +90,15 @@
         app.add_subcommand("update-bios-attr-table",
                            "Update the bios attribute table with the host "
                            "firmware data details.")
-            ->callback([&bus, &loop, &subcommandContext, extensionMap]() {
-                auto elementsJsonFilePath = "/usr/share/hostfw/elements.json"s;
-                auto subcommands =
-                    functions::process_hostfirmware::updateBiosAttrTable(
-                        bus, extensionMap, std::move(elementsJsonFilePath),
-                        loop);
-                for (const auto& subcommand : subcommands)
-                {
-                    subcommandContext.push_back(subcommand);
-                }
+            ->callback(
+                [&bus, &loop, &subcommandContext, extensionMap]() {
+        auto elementsJsonFilePath = "/usr/share/hostfw/elements.json"s;
+        auto subcommands = functions::process_hostfirmware::updateBiosAttrTable(
+            bus, extensionMap, std::move(elementsJsonFilePath), loop);
+        for (const auto& subcommand : subcommands)
+        {
+            subcommandContext.push_back(subcommand);
+        }
             }));
 
     CLI11_PARSE(app, argc, argv);
diff --git a/mmc/activation_mmc.cpp b/mmc/activation_mmc.cpp
index a50e99b..2192f8a 100644
--- a/mmc/activation_mmc.cpp
+++ b/mmc/activation_mmc.cpp
@@ -13,14 +13,11 @@
     return softwareServer::Activation::activation(value);
 }
 
-void ActivationMMC::startActivation()
-{}
+void ActivationMMC::startActivation() {}
 
-void ActivationMMC::unitStateChange(sdbusplus::message_t&)
-{}
+void ActivationMMC::unitStateChange(sdbusplus::message_t&) {}
 
-void ActivationMMC::finishActivation()
-{}
+void ActivationMMC::finishActivation() {}
 
 } // namespace updater
 } // namespace software
diff --git a/mmc/item_updater_mmc.cpp b/mmc/item_updater_mmc.cpp
index 3872b96..75ef284 100644
--- a/mmc/item_updater_mmc.cpp
+++ b/mmc/item_updater_mmc.cpp
@@ -58,8 +58,7 @@
     return true;
 }
 
-void ItemUpdaterMMC::processPNORImage()
-{}
+void ItemUpdaterMMC::processPNORImage() {}
 
 void ItemUpdaterMMC::reset()
 {
@@ -136,19 +135,16 @@
     return versionId == functionalVersionId;
 }
 
-void ItemUpdaterMMC::freePriority(uint8_t, const std::string&)
-{}
+void ItemUpdaterMMC::freePriority(uint8_t, const std::string&) {}
 
-void ItemUpdaterMMC::deleteAll()
-{}
+void ItemUpdaterMMC::deleteAll() {}
 
 bool ItemUpdaterMMC::freeSpace()
 {
     return true;
 }
 
-void ItemUpdaterMMC::updateFunctionalAssociation(const std::string&)
-{}
+void ItemUpdaterMMC::updateFunctionalAssociation(const std::string&) {}
 void GardResetMMC::enableInventoryItems()
 {
     (void)enableInventoryItemsHelper(
@@ -182,9 +178,9 @@
         response.read(objs);
         for (auto& obj : objs)
         {
-            auto method =
-                bus.new_method_call(service.c_str(), obj.c_str(),
-                                    "org.freedesktop.DBus.Properties", "Set");
+            auto method = bus.new_method_call(service.c_str(), obj.c_str(),
+                                              "org.freedesktop.DBus.Properties",
+                                              "Set");
             std::variant<bool> propertyVal{true};
             method.append("xyz.openbmc_project.Object.Enable", "Enabled",
                           propertyVal);
diff --git a/msl_verify.cpp b/msl_verify.cpp
index 1be1d04..316c482 100644
--- a/msl_verify.cpp
+++ b/msl_verify.cpp
@@ -171,7 +171,7 @@
     auto rc = 0;
     std::string tmpMin{};
 
-    for (auto const& min : mins)
+    for (const auto& min : mins)
     {
         tmpMin = min;
 
diff --git a/static/activation_static.cpp b/static/activation_static.cpp
index 9b451cf..d4f8329 100644
--- a/static/activation_static.cpp
+++ b/static/activation_static.cpp
@@ -16,7 +16,6 @@
 
 auto ActivationStatic::activation(Activations value) -> Activations
 {
-
     auto ret = value;
     if (value != softwareServer::Activation::Activations::Active)
     {
@@ -99,8 +98,8 @@
     std::replace(pnorFileEscaped.begin(), pnorFileEscaped.end(), '/', '-');
 
     constexpr auto updatePNORService = "openpower-pnor-update@";
-    pnorUpdateUnit =
-        std::string(updatePNORService) + pnorFileEscaped + ".service";
+    pnorUpdateUnit = std::string(updatePNORService) + pnorFileEscaped +
+                     ".service";
     auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
                                       SYSTEMD_INTERFACE, "StartUnit");
     method.append(pnorUpdateUnit, "replace");
@@ -140,8 +139,8 @@
     // Set Redundancy Priority before setting to Active
     if (!redundancyPriority)
     {
-        redundancyPriority =
-            std::make_unique<RedundancyPriority>(bus, path, *this, 0);
+        redundancyPriority = std::make_unique<RedundancyPriority>(bus, path,
+                                                                  *this, 0);
     }
 
     activationProgress->progress(100);
diff --git a/static/item_updater_static.cpp b/static/item_updater_static.cpp
index 8eea808..630e8ae 100644
--- a/static/item_updater_static.cpp
+++ b/static/item_updater_static.cpp
@@ -29,7 +29,7 @@
 {
 
 template <typename... Ts>
-std::string concat_string(Ts const&... ts)
+std::string concat_string(const Ts&... ts)
 {
     std::stringstream s;
     ((s << ts << " "), ...) << std::endl;
@@ -39,7 +39,7 @@
 // Helper function to run pflash command
 // Returns return code and the stdout
 template <typename... Ts>
-std::pair<int, std::string> pflash(Ts const&... ts)
+std::pair<int, std::string> pflash(const Ts&... ts)
 {
     std::array<char, 512> buffer;
     std::string cmd = concat_string("pflash", ts...);
@@ -79,8 +79,8 @@
     fs::path versionFile = tmpDir;
     versionFile /= "version";
 
-    auto [rc, r] =
-        pflash("-P VERSION -r", versionFile.string(), "2>&1 > /dev/null");
+    auto [rc, r] = pflash("-P VERSION -r", versionFile.string(),
+                          "2>&1 > /dev/null");
     if (rc != 0)
     {
         log<level::ERR>("Failed to read VERSION", entry("RETURNCODE=%d", rc));
@@ -162,14 +162,14 @@
             {
                 continue;
             }
-            line = line.substr(pos); // Skiping "ID=xx"
+            line = line.substr(pos);           // Skiping "ID=xx"
 
             pos = line.find_first_not_of(' '); // After spaces
             if (pos == std::string::npos)
             {
                 continue;
             }
-            line = line.substr(pos); // Skipping spaces
+            line = line.substr(pos);       // Skipping spaces
 
             pos = line.find_first_of(' '); // The end of part name
             if (pos == std::string::npos)
@@ -326,8 +326,7 @@
     return versionId == functionalVersionId;
 }
 
-void ItemUpdaterStatic::freePriority(uint8_t, const std::string&)
-{}
+void ItemUpdaterStatic::freePriority(uint8_t, const std::string&) {}
 
 void ItemUpdaterStatic::deleteAll()
 {
diff --git a/test/test_item_updater_static.cpp b/test/test_item_updater_static.cpp
index 80c2fd2..55a9a70 100644
--- a/test/test_item_updater_static.cpp
+++ b/test/test_item_updater_static.cpp
@@ -112,13 +112,13 @@
     // Verify the it does not crash on malformed texts
     constexpr auto info =
         "0x0308a000..0x0308f000(actual=0x00005000)"
-        "[E-----F-CV]\n" // missing ID and name with F
+        "[E-----F-CV]\n"  // missing ID and name with F
         "ID=27 HB_VOLATILE 0x0308a000..0x0308f000 (actual=0x00005000) "
-        "E-----F-CV]\n" // missing [
+        "E-----F-CV]\n"   // missing [
         "ID=22   ATTR_PERM 0x02d20000..0x02d28000 (actual=0x00008000) "
-        "[E-----F-C-]\n" // The only valid one
+        "[E-----F-C-]\n"  // The only valid one
         "ID=28        MEMD 0x0308f000..0x0309d000 (actual=0x0000e000) "
-        "[----]\n" // missing flags
+        "[----]\n"        // missing flags
         "SBKT 0x0309d000..0x030a1000 (actual=0x00004000) "
         "[EL--R-----]\n"; // missing ID
 
diff --git a/test/test_signature.cpp b/test/test_signature.cpp
index f852382..8cfe897 100644
--- a/test/test_signature.cpp
+++ b/test/test_signature.cpp
@@ -71,8 +71,8 @@
         command("openssl rsa -in " + pkeyFile + " -outform PEM " +
                 "-pubout -out " + pubkeyFile);
 
-        std::string pubKeyConfFile =
-            signedConfPNORPath.string() + "/" + "publickey";
+        std::string pubKeyConfFile = signedConfPNORPath.string() + "/" +
+                                     "publickey";
         command("cp " + pubkeyFile + " " + signedConfPNORPath.string());
         command(opensslCmd + pkeyFile + " -out " + pnorFile + ".sig " +
                 pnorFile);
diff --git a/test/test_version.cpp b/test/test_version.cpp
index 523b52a..448d95e 100644
--- a/test/test_version.cpp
+++ b/test/test_version.cpp
@@ -12,7 +12,6 @@
 /** @brief Make sure we correctly get the Id from getId()*/
 TEST(VersionTest, TestGetId)
 {
-
     auto version = "test-id";
     unsigned char digest[EVP_MAX_MD_SIZE];
     unsigned int digest_count = 0;
@@ -49,8 +48,8 @@
         "\tsbe-cf61dc3\n"
         "\thcode-hw123119a.930";
 
-    const auto& [version, extendedVersion] =
-        Version::getVersions(versionString);
+    const auto& [version,
+                 extendedVersion] = Version::getVersions(versionString);
     EXPECT_EQ(version, "open-power-romulus-v2.2-rc1-48-g268344f-dirty");
     EXPECT_EQ(extendedVersion, "buildroot-2018.11.1-7-g5d7cc8c,"
                                "skiboot-v6.2,"
diff --git a/ubi/activation_ubi.cpp b/ubi/activation_ubi.cpp
index 205c393..3bb7c25 100644
--- a/ubi/activation_ubi.cpp
+++ b/ubi/activation_ubi.cpp
@@ -24,7 +24,6 @@
 
 auto ActivationUbi::activation(Activations value) -> Activations
 {
-
     if (value != softwareServer::Activation::Activations::Active)
     {
         redundancyPriority.reset(nullptr);
@@ -119,8 +118,8 @@
     }
 
     constexpr auto ubimountService = "obmc-flash-bios-ubimount@";
-    auto ubimountServiceFile =
-        std::string(ubimountService) + versionId + ".service";
+    auto ubimountServiceFile = std::string(ubimountService) + versionId +
+                               ".service";
     auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
                                       SYSTEMD_INTERFACE, "StartUnit");
     method.append(ubimountServiceFile, "replace");
@@ -139,8 +138,8 @@
     // Read the msg and populate each variable
     msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult);
 
-    auto ubimountServiceFile =
-        "obmc-flash-bios-ubimount@" + versionId + ".service";
+    auto ubimountServiceFile = "obmc-flash-bios-ubimount@" + versionId +
+                               ".service";
 
     if (newStateUnit == ubimountServiceFile && newStateResult == "done")
     {
@@ -169,8 +168,8 @@
     // Set Redundancy Priority before setting to Active
     if (!redundancyPriority)
     {
-        redundancyPriority =
-            std::make_unique<RedundancyPriorityUbi>(bus, path, *this, 0);
+        redundancyPriority = std::make_unique<RedundancyPriorityUbi>(bus, path,
+                                                                     *this, 0);
     }
 
     activationProgress->progress(100);
diff --git a/ubi/item_updater_ubi.cpp b/ubi/item_updater_ubi.cpp
index dc0c62b..3fc64ae 100644
--- a/ubi/item_updater_ubi.cpp
+++ b/ubi/item_updater_ubi.cpp
@@ -147,8 +147,8 @@
             auto versionPtr = std::make_unique<Version>(
                 bus, path, *this, id, version, purpose, "",
                 std::bind(&ItemUpdaterUbi::erase, this, std::placeholders::_1));
-            versionPtr->deleteObject =
-                std::make_unique<Delete>(bus, path, *versionPtr);
+            versionPtr->deleteObject = std::make_unique<Delete>(bus, path,
+                                                                *versionPtr);
             versions.insert(std::make_pair(id, std::move(versionPtr)));
         }
         else if (0 == iter.path().native().compare(0, PNOR_RW_PREFIX_LEN,
diff --git a/ubi/serialize.cpp b/ubi/serialize.cpp
index 4aa492a..50127a2 100644
--- a/ubi/serialize.cpp
+++ b/ubi/serialize.cpp
@@ -116,8 +116,8 @@
     auto bus = sdbusplus::bus::new_default();
 
     // Clear the environment variable pnor-[versionId].
-    std::string serviceFile =
-        "obmc-flash-bmc-setenv@pnor\\x2d" + versionId + ".service";
+    std::string serviceFile = "obmc-flash-bmc-setenv@pnor\\x2d" + versionId +
+                              ".service";
     auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
                                       SYSTEMD_INTERFACE, "StartUnit");
     method.append(serviceFile, "replace");
diff --git a/ubi/watch.hpp b/ubi/watch.hpp
index 2628e93..eef2b2a 100644
--- a/ubi/watch.hpp
+++ b/ubi/watch.hpp
@@ -41,8 +41,7 @@
      *
      *  @param[in] fd - File descriptor
      */
-    explicit CustomFd(int fd) : fd(fd)
-    {}
+    explicit CustomFd(int fd) : fd(fd) {}
 
     ~CustomFd()
     {
diff --git a/version.cpp b/version.cpp
index 574e298..7ab2c48 100644
--- a/version.cpp
+++ b/version.cpp
@@ -30,7 +30,6 @@
 
 std::string Version::getId(const std::string& version)
 {
-
     if (version.empty())
     {
         log<level::ERR>("Error version is empty");