diff --git a/.clang-format b/.clang-format
index ef6f54e..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
@@ -108,7 +122,7 @@
 SpacesInCStyleCastParentheses: false
 SpacesInParentheses: false
 SpacesInSquareBrackets: false
-Standard:        Cpp11
+Standard:        Latest
 TabWidth:        4
 UseTab:          Never
 ...
diff --git a/bmc/buildjson.hpp b/bmc/buildjson.hpp
index d8f8c80..f064b41 100644
--- a/bmc/buildjson.hpp
+++ b/bmc/buildjson.hpp
@@ -64,7 +64,6 @@
      */
     std::vector<HandlerConfig<T>> buildHandlerConfigs(const char* directory)
     {
-
         std::vector<HandlerConfig<T>> output;
 
         std::vector<std::string> jsonPaths = GetJsonList(directory);
diff --git a/bmc/file_handler.hpp b/bmc/file_handler.hpp
index bf31f40..a0c23af 100644
--- a/bmc/file_handler.hpp
+++ b/bmc/file_handler.hpp
@@ -20,8 +20,7 @@
      * @param[in] filename - file to use for the contents, fully
      * qualified file system path.
      */
-    explicit FileHandler(const std::string& filename) : filename(filename)
-    {}
+    explicit FileHandler(const std::string& filename) : filename(filename) {}
 
     bool open(const std::string& path,
               std::ios_base::openmode mode = std::ios::out) override;
diff --git a/bmc/firmware-handler/firmware_handler.cpp b/bmc/firmware-handler/firmware_handler.cpp
index 9268809..d11702f 100644
--- a/bmc/firmware-handler/firmware_handler.cpp
+++ b/bmc/firmware-handler/firmware_handler.cpp
@@ -57,9 +57,10 @@
 
     std::vector<std::string> blobs;
     blobs.reserve(firmwares.size());
-    std::for_each(
-        firmwares.begin(), firmwares.end(),
-        [&blobs](const auto& blob) { blobs.emplace_back(blob.blobName); });
+    std::for_each(firmwares.begin(), firmwares.end(),
+                  [&blobs](const auto& blob) {
+        blobs.emplace_back(blob.blobName);
+    });
 
     if (0 == std::count(blobs.begin(), blobs.end(), hashBlobId))
     {
@@ -421,8 +422,8 @@
     /* How are they expecting to copy this data? */
     auto d = std::find_if(transports.begin(), transports.end(),
                           [&transportFlag](const auto& iter) {
-                              return (iter.bitmask == transportFlag);
-                          });
+        return (iter.bitmask == transportFlag);
+    });
     if (d == transports.end())
     {
         return false;
@@ -449,9 +450,10 @@
      * firmware handers (and file handlers, like this'll know where to write the
      * tarball, etc).
      */
-    auto h = std::find_if(
-        handlers.begin(), handlers.end(),
-        [&path](const auto& iter) { return (iter.blobName == path); });
+    auto h = std::find_if(handlers.begin(), handlers.end(),
+                          [&path](const auto& iter) {
+        return (iter.blobName == path);
+    });
     if (h == handlers.end())
     {
         return false;
diff --git a/bmc/firmware-handler/firmware_handler.hpp b/bmc/firmware-handler/firmware_handler.hpp
index 505f1a7..4f32b29 100644
--- a/bmc/firmware-handler/firmware_handler.hpp
+++ b/bmc/firmware-handler/firmware_handler.hpp
@@ -192,9 +192,10 @@
 
     void addBlobId(const std::string& blob)
     {
-        auto blobIdMatch = std::find_if(
-            blobIDs.begin(), blobIDs.end(),
-            [&blob](const std::string& iter) { return (iter == blob); });
+        auto blobIdMatch = std::find_if(blobIDs.begin(), blobIDs.end(),
+                                        [&blob](const std::string& iter) {
+            return (iter == blob);
+        });
         if (blobIdMatch == blobIDs.end())
         {
             blobIDs.push_back(blob);
diff --git a/bmc/firmware-handler/mapper_errors.hpp b/bmc/firmware-handler/mapper_errors.hpp
index 7717f4b..28be925 100644
--- a/bmc/firmware-handler/mapper_errors.hpp
+++ b/bmc/firmware-handler/mapper_errors.hpp
@@ -9,8 +9,7 @@
 class MapperException : public std::exception
 {
   public:
-    explicit MapperException(const std::string& message) : message(message)
-    {}
+    explicit MapperException(const std::string& message) : message(message) {}
 
     virtual const char* what() const noexcept override
     {
diff --git a/bmc/firmware-handler/net_handler.hpp b/bmc/firmware-handler/net_handler.hpp
index b107e72..4582e26 100644
--- a/bmc/firmware-handler/net_handler.hpp
+++ b/bmc/firmware-handler/net_handler.hpp
@@ -19,8 +19,7 @@
 class NetDataHandler : public DataInterface
 {
   public:
-    NetDataHandler() : listenFd(std::nullopt), connFd(std::nullopt)
-    {}
+    NetDataHandler() : listenFd(std::nullopt), connFd(std::nullopt) {}
 
     bool open() override;
     bool close() override;
diff --git a/bmc/general_systemd.cpp b/bmc/general_systemd.cpp
index ce16d14..02c3aea 100644
--- a/bmc/general_systemd.cpp
+++ b/bmc/general_systemd.cpp
@@ -141,8 +141,8 @@
                  job->c_str(), result.c_str());
     jobMonitor = std::nullopt;
     job = std::nullopt;
-    currentStatus =
-        result == "done" ? ActionStatus::success : ActionStatus::failed;
+    currentStatus = result == "done" ? ActionStatus::success
+                                     : ActionStatus::failed;
 
     if (cb)
     {
diff --git a/bmc/log-handler/log_handler.cpp b/bmc/log-handler/log_handler.cpp
index 1883128..9a0d296 100644
--- a/bmc/log-handler/log_handler.cpp
+++ b/bmc/log-handler/log_handler.cpp
@@ -36,44 +36,41 @@
         info->handler = std::move(config.handler);
         info->actions->onOpen->setCallback(
             [infoP = info.get()](TriggerableActionInterface& tai) {
-                auto data =
-                    std::make_shared<std::optional<std::vector<uint8_t>>>();
-                do
+            auto data = std::make_shared<std::optional<std::vector<uint8_t>>>();
+            do
+            {
+                if (tai.status() != ActionStatus::success)
                 {
-                    if (tai.status() != ActionStatus::success)
-                    {
-                        fprintf(stderr,
-                                "LogBlobHandler: Log file unit failed for %s\n",
-                                infoP->blobId.c_str());
-                        continue;
-                    }
-                    if (!infoP->handler->open("", std::ios::in))
-                    {
-                        fprintf(
-                            stderr,
+                    fprintf(stderr,
+                            "LogBlobHandler: Log file unit failed for %s\n",
+                            infoP->blobId.c_str());
+                    continue;
+                }
+                if (!infoP->handler->open("", std::ios::in))
+                {
+                    fprintf(stderr,
                             "LogBlobHandler: Opening log file failed for %s\n",
                             infoP->blobId.c_str());
-                        continue;
-                    }
-                    auto d = infoP->handler->read(
-                        0, std::numeric_limits<uint32_t>::max());
-                    infoP->handler->close();
-                    if (!d)
-                    {
-                        fprintf(
-                            stderr,
+                    continue;
+                }
+                auto d = infoP->handler->read(
+                    0, std::numeric_limits<uint32_t>::max());
+                infoP->handler->close();
+                if (!d)
+                {
+                    fprintf(stderr,
                             "LogBlobHandler: Reading log file failed for %s\n",
                             infoP->blobId.c_str());
-                        continue;
-                    }
-                    *data = std::move(d);
-                } while (false);
-                for (auto sessionP : infoP->sessionsToUpdate)
-                {
-                    sessionP->data = data;
+                    continue;
                 }
-                infoP->sessionsToUpdate.clear();
-            });
+                *data = std::move(d);
+            } while (false);
+            for (auto sessionP : infoP->sessionsToUpdate)
+            {
+                sessionP->data = data;
+            }
+            infoP->sessionsToUpdate.clear();
+        });
         if (!blobInfoMap.try_emplace(info->blobId, std::move(info)).second)
         {
             fprintf(stderr,
@@ -211,8 +208,8 @@
     }
     else
     {
-        meta->blobState =
-            blobs::StateFlags::committed | blobs::StateFlags::open_read;
+        meta->blobState = blobs::StateFlags::committed |
+                          blobs::StateFlags::open_read;
         meta->size = (*data)->size();
     }
     return true;
diff --git a/bmc/skip_action.cpp b/bmc/skip_action.cpp
index f1a67e0..dc40932 100644
--- a/bmc/skip_action.cpp
+++ b/bmc/skip_action.cpp
@@ -35,8 +35,7 @@
     return true;
 }
 
-void SkipAction::abort()
-{}
+void SkipAction::abort() {}
 
 ActionStatus SkipAction::status()
 {
diff --git a/bmc/version-handler/version_handler.cpp b/bmc/version-handler/version_handler.cpp
index 0efdcf7..f26884b 100644
--- a/bmc/version-handler/version_handler.cpp
+++ b/bmc/version-handler/version_handler.cpp
@@ -23,39 +23,38 @@
         info->handler = std::move(config.handler);
         info->actions->onOpen->setCallback(
             [infoP = info.get()](TriggerableActionInterface& tai) {
-                auto data =
-                    std::make_shared<std::optional<std::vector<uint8_t>>>();
-                do
+            auto data = std::make_shared<std::optional<std::vector<uint8_t>>>();
+            do
+            {
+                if (tai.status() != ActionStatus::success)
                 {
-                    if (tai.status() != ActionStatus::success)
-                    {
-                        fprintf(stderr, "Version file unit failed for %s\n",
-                                infoP->blobId.c_str());
-                        continue;
-                    }
-                    if (!infoP->handler->open("", std::ios::in))
-                    {
-                        fprintf(stderr, "Opening version file failed for %s\n",
-                                infoP->blobId.c_str());
-                        continue;
-                    }
-                    auto d = infoP->handler->read(
-                        0, std::numeric_limits<uint32_t>::max());
-                    infoP->handler->close();
-                    if (!d)
-                    {
-                        fprintf(stderr, "Reading version file failed for %s\n",
-                                infoP->blobId.c_str());
-                        continue;
-                    }
-                    *data = std::move(d);
-                } while (false);
-                for (auto sessionP : infoP->sessionsToUpdate)
-                {
-                    sessionP->data = data;
+                    fprintf(stderr, "Version file unit failed for %s\n",
+                            infoP->blobId.c_str());
+                    continue;
                 }
-                infoP->sessionsToUpdate.clear();
-            });
+                if (!infoP->handler->open("", std::ios::in))
+                {
+                    fprintf(stderr, "Opening version file failed for %s\n",
+                            infoP->blobId.c_str());
+                    continue;
+                }
+                auto d = infoP->handler->read(
+                    0, std::numeric_limits<uint32_t>::max());
+                infoP->handler->close();
+                if (!d)
+                {
+                    fprintf(stderr, "Reading version file failed for %s\n",
+                            infoP->blobId.c_str());
+                    continue;
+                }
+                *data = std::move(d);
+            } while (false);
+            for (auto sessionP : infoP->sessionsToUpdate)
+            {
+                sessionP->data = data;
+            }
+            infoP->sessionsToUpdate.clear();
+        });
         if (!blobInfoMap.try_emplace(info->blobId, std::move(info)).second)
         {
             fprintf(stderr, "Ignoring duplicate config for %s\n",
@@ -170,8 +169,8 @@
     }
     else
     {
-        meta->blobState =
-            blobs::StateFlags::committed | blobs::StateFlags::open_read;
+        meta->blobState = blobs::StateFlags::committed |
+                          blobs::StateFlags::open_read;
         meta->size = (*data)->size();
     }
     return true;
diff --git a/tools/handler.cpp b/tools/handler.cpp
index cc73e13..d241b9f 100644
--- a/tools/handler.cpp
+++ b/tools/handler.cpp
@@ -52,15 +52,15 @@
 {
     std::vector<std::string> blobs = blob->getBlobList();
 
-    auto blobInst = std::find_if(
-        blobs.begin(), blobs.end(), [&goalFirmware](const std::string& iter) {
-            /* Running into weird scenarios where the string comparison doesn't
-             * work.  TODO: revisit.
-             */
-            return (0 == std::memcmp(goalFirmware.c_str(), iter.c_str(),
-                                     goalFirmware.length()));
-            // return (goalFirmware.compare(iter));
-        });
+    auto blobInst = std::find_if(blobs.begin(), blobs.end(),
+                                 [&goalFirmware](const std::string& iter) {
+        /* Running into weird scenarios where the string comparison doesn't
+         * work.  TODO: revisit.
+         */
+        return (0 == std::memcmp(goalFirmware.c_str(), iter.c_str(),
+                                 goalFirmware.length()));
+        // return (goalFirmware.compare(iter));
+    });
     if (blobInst == blobs.end())
     {
         std::fprintf(stderr, "%s not found\n", goalFirmware.c_str());
diff --git a/tools/helper.cpp b/tools/helper.cpp
index 3388a29..15c363f 100644
--- a/tools/helper.cpp
+++ b/tools/helper.cpp
@@ -163,10 +163,10 @@
         }
     }
 
-    auto srcMem8 =
-        reinterpret_cast<const volatile std::uint8_t*>(source) + bytesCopied;
-    auto destMem8 =
-        reinterpret_cast<volatile std::uint8_t*>(destination) + bytesCopied;
+    auto srcMem8 = reinterpret_cast<const volatile std::uint8_t*>(source) +
+                   bytesCopied;
+    auto destMem8 = reinterpret_cast<volatile std::uint8_t*>(destination) +
+                    bytesCopied;
 
     for (i = bytesCopied; i < size; i++)
     {
diff --git a/tools/io.cpp b/tools/io.cpp
index 9af8ace..c84a8b3 100644
--- a/tools/io.cpp
+++ b/tools/io.cpp
@@ -38,8 +38,8 @@
         return false;
     }
 
-    void* alignedSource =
-        static_cast<std::uint8_t*>(devMemMapped) + alignedDiff;
+    void* alignedSource = static_cast<std::uint8_t*>(devMemMapped) +
+                          alignedDiff;
 
     /* Copy the bytes. */
     std::memcpy(destination, alignedSource, length);
@@ -78,8 +78,8 @@
         return false;
     }
 
-    void* alignedDestination =
-        static_cast<std::uint8_t*>(devMemMapped) + alignedDiff;
+    void* alignedDestination = static_cast<std::uint8_t*>(devMemMapped) +
+                               alignedDiff;
 
     /* Copy the bytes. */
     std::memcpy(alignedDestination, source, length);
diff --git a/tools/lpc.cpp b/tools/lpc.cpp
index c7f4013..e415331 100644
--- a/tools/lpc.cpp
+++ b/tools/lpc.cpp
@@ -125,8 +125,8 @@
 
         do
         {
-            bytesRead =
-                sys->read(inputFd, readBuffer.get(), host_lpc_buf.length);
+            bytesRead = sys->read(inputFd, readBuffer.get(),
+                                  host_lpc_buf.length);
             if (bytesRead > 0)
             {
                 if (!io->write(host_lpc_buf.address, bytesRead,
diff --git a/tools/main.cpp b/tools/main.cpp
index 1ce68a4..5bda3a0 100644
--- a/tools/main.cpp
+++ b/tools/main.cpp
@@ -80,8 +80,8 @@
 
 bool checkInterface(const std::string& interface)
 {
-    auto intf =
-        std::find(interfaceList.begin(), interfaceList.end(), interface);
+    auto intf = std::find(interfaceList.begin(), interfaceList.end(),
+                          interface);
     return (intf != interfaceList.end());
 }
 
@@ -226,8 +226,8 @@
         /* Input has already been validated in this case. */
         if (interface == IPMIBT)
         {
-            handler =
-                std::make_unique<host_tool::BtDataHandler>(&blob, &progress);
+            handler = std::make_unique<host_tool::BtDataHandler>(&blob,
+                                                                 &progress);
         }
         else if (interface == IPMINET)
         {
diff --git a/tools/progress.cpp b/tools/progress.cpp
index 68b31cc..3904efc 100644
--- a/tools/progress.cpp
+++ b/tools/progress.cpp
@@ -39,10 +39,8 @@
     currentBytes = 0;
 }
 
-void ProgressStdoutIndicator::finish()
-{}
+void ProgressStdoutIndicator::finish() {}
 
-void ProgressStdoutIndicator::abort()
-{}
+void ProgressStdoutIndicator::abort() {}
 
 } // namespace host_tool
diff --git a/tools/test/data_interface_mock.hpp b/tools/test/data_interface_mock.hpp
index c69de72..a533a32 100644
--- a/tools/test/data_interface_mock.hpp
+++ b/tools/test/data_interface_mock.hpp
@@ -9,7 +9,6 @@
 
 class DataInterfaceMock : public DataInterface
 {
-
   public:
     virtual ~DataInterfaceMock() = default;
 
diff --git a/tools/test/io_unittest.cpp b/tools/test/io_unittest.cpp
index 492c699..2a3f90c 100644
--- a/tools/test/io_unittest.cpp
+++ b/tools/test/io_unittest.cpp
@@ -21,8 +21,7 @@
 class DevMemTest : public ::testing::Test
 {
   protected:
-    DevMemTest() : devmem(std::make_unique<DevMemDevice>(&sys_mock))
-    {}
+    DevMemTest() : devmem(std::make_unique<DevMemDevice>(&sys_mock)) {}
 
     internal::InternalSysMock sys_mock;
     std::unique_ptr<DevMemDevice> devmem;
@@ -104,8 +103,7 @@
   protected:
     static constexpr char path[] = "/dev/fun";
 
-    PpcMemTest() : devmem(std::make_unique<PpcMemDevice>(path, &sys_mock))
-    {}
+    PpcMemTest() : devmem(std::make_unique<PpcMemDevice>(path, &sys_mock)) {}
 
     internal::InternalSysMock sys_mock;
     std::unique_ptr<PpcMemDevice> devmem;
diff --git a/tools/test/tools_helper_unittest.cpp b/tools/test/tools_helper_unittest.cpp
index cfe5208..572e136 100644
--- a/tools/test/tools_helper_unittest.cpp
+++ b/tools/test/tools_helper_unittest.cpp
@@ -51,8 +51,8 @@
 {
     ipmiblob::StatResponse blobResponse = {};
     /* the other details of the response are ignored, and should be. */
-    blobResponse.blob_state =
-        blobs::StateFlags::open_read | blobs::StateFlags::committed;
+    blobResponse.blob_state = blobs::StateFlags::open_read |
+                              blobs::StateFlags::committed;
 
     EXPECT_CALL(blobMock, getStat(TypedEq<std::uint16_t>(session)))
         .WillOnce(Return(blobResponse));
diff --git a/tools/test/tools_pci_unittest.cpp b/tools/test/tools_pci_unittest.cpp
index c3ce610..96a204a 100644
--- a/tools/test/tools_pci_unittest.cpp
+++ b/tools/test/tools_pci_unittest.cpp
@@ -338,8 +338,8 @@
 INSTANTIATE_TEST_SUITE_P(Default, PciSetupTest,
                          ::testing::Values(&nuvotonDevice, &aspeedDevice),
                          [](const testing::TestParamInfo<Device*>& info) {
-                             return info.param->getName();
-                         });
+    return info.param->getName();
+});
 
 TEST(NuvotonWriteTest, TooLarge)
 {
@@ -660,8 +660,8 @@
 
     {
         std::vector<std::uint8_t> enabledRegion(mockRegionSize);
-        enabledRegion[AspeedDevice::config] =
-            defaultVal | AspeedDevice::bridgeEnabled;
+        enabledRegion[AspeedDevice::config] = defaultVal |
+                                              AspeedDevice::bridgeEnabled;
         EXPECT_THAT(region, ContainerEq(enabledRegion));
     }
 
@@ -689,13 +689,13 @@
     expectSetup(pciMock, dev, &aspeedDevice, region.data());
 
     /* Setting skipBridgeDisable to true */
-    std::unique_ptr<PciBridgeIntf> bridge =
-        aspeedDevice.getBridge(&pciMock, true);
+    std::unique_ptr<PciBridgeIntf> bridge = aspeedDevice.getBridge(&pciMock,
+                                                                   true);
 
     {
         std::vector<std::uint8_t> enabledRegion(mockRegionSize);
-        enabledRegion[AspeedDevice::config] =
-            defaultVal | AspeedDevice::bridgeEnabled;
+        enabledRegion[AspeedDevice::config] = defaultVal |
+                                              AspeedDevice::bridgeEnabled;
         EXPECT_THAT(region, ContainerEq(enabledRegion));
     }
 
@@ -703,8 +703,8 @@
 
     {
         std::vector<std::uint8_t> disabledRegion(mockRegionSize);
-        disabledRegion[AspeedDevice::config] =
-            defaultVal | AspeedDevice::bridgeEnabled;
+        disabledRegion[AspeedDevice::config] = defaultVal |
+                                               AspeedDevice::bridgeEnabled;
         EXPECT_THAT(region, ContainerEq(disabledRegion));
     }
 }
@@ -726,8 +726,8 @@
 
     {
         std::vector<std::uint8_t> enabledRegion(mockRegionSize);
-        enabledRegion[AspeedDevice::config] =
-            defaultVal | AspeedDevice::bridgeEnabled;
+        enabledRegion[AspeedDevice::config] = defaultVal |
+                                              AspeedDevice::bridgeEnabled;
         EXPECT_THAT(region, ContainerEq(enabledRegion));
     }
 
diff --git a/tools/test/tools_updater_unittest.cpp b/tools/test/tools_updater_unittest.cpp
index e04cde8..ac21a1e 100644
--- a/tools/test/tools_updater_unittest.cpp
+++ b/tools/test/tools_updater_unittest.cpp
@@ -204,8 +204,8 @@
     EXPECT_CALL(blobMock, openBlob(ipmi_flash::biosVersionBlobId, _))
         .WillOnce(Return(session));
     ipmiblob::StatResponse readVersionResponse = {};
-    readVersionResponse.blob_state =
-        blobs::StateFlags::open_read | blobs::StateFlags::committed;
+    readVersionResponse.blob_state = blobs::StateFlags::open_read |
+                                     blobs::StateFlags::committed;
     readVersionResponse.size = 10;
     EXPECT_CALL(blobMock, getStat(TypedEq<std::uint16_t>(session)))
         .WillOnce(Return(readVersionResponse));
@@ -222,8 +222,8 @@
     EXPECT_CALL(blobMock, openBlob(ipmi_flash::biosVersionBlobId, _))
         .WillOnce(Return(session));
     ipmiblob::StatResponse readVersionResponse = {};
-    readVersionResponse.blob_state =
-        blobs::StateFlags::open_read | blobs::StateFlags::committed;
+    readVersionResponse.blob_state = blobs::StateFlags::open_read |
+                                     blobs::StateFlags::committed;
     readVersionResponse.size = 10;
     EXPECT_CALL(blobMock, getStat(TypedEq<std::uint16_t>(session)))
         .WillOnce(Return(readVersionResponse));
