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/bmc/file_handler.cpp b/bmc/file_handler.cpp
index 829f92c..8005b8f 100644
--- a/bmc/file_handler.cpp
+++ b/bmc/file_handler.cpp
@@ -52,8 +52,8 @@
     return file.good();
 }
 
-std::optional<std::vector<uint8_t>> FileHandler::read(std::uint32_t offset,
-                                                      std::uint32_t size)
+std::optional<std::vector<uint8_t>>
+    FileHandler::read(std::uint32_t offset, std::uint32_t size)
 {
     uint32_t file_size = getSize();
     if (offset > file_size)
diff --git a/bmc/firmware-handler/data_handler.hpp b/bmc/firmware-handler/data_handler.hpp
index 162347c..5548f95 100644
--- a/bmc/firmware-handler/data_handler.hpp
+++ b/bmc/firmware-handler/data_handler.hpp
@@ -62,8 +62,7 @@
 
     DataHandlerPack(std::uint16_t bitmask,
                     std::unique_ptr<DataInterface> handler) :
-        bitmask(bitmask),
-        handler(std::move(handler))
+        bitmask(bitmask), handler(std::move(handler))
     {}
 
     /* Don't allow copying, assignment or move assignment, only moving. */
diff --git a/bmc/firmware-handler/firmware_handler.cpp b/bmc/firmware-handler/firmware_handler.cpp
index 3d9b3fd..116bc07 100644
--- a/bmc/firmware-handler/firmware_handler.cpp
+++ b/bmc/firmware-handler/firmware_handler.cpp
@@ -57,18 +57,19 @@
 
     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))
     {
         return nullptr;
     }
 
-    return std::make_unique<FirmwareBlobHandler>(std::move(firmwares), blobs,
-                                                 std::move(transports),
-                                                 std::move(actionPacks));
+    return std::make_unique<FirmwareBlobHandler>(
+        std::move(firmwares), blobs, std::move(transports),
+        std::move(actionPacks));
 }
 
 /* Check if the path is in our supported list (or active list). */
@@ -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;
diff --git a/bmc/firmware-handler/firmware_handler.hpp b/bmc/firmware-handler/firmware_handler.hpp
index 505f1a7..1a45328 100644
--- a/bmc/firmware-handler/firmware_handler.hpp
+++ b/bmc/firmware-handler/firmware_handler.hpp
@@ -123,11 +123,11 @@
                         const std::vector<std::string>& blobs,
                         std::vector<DataHandlerPack>&& transports,
                         ActionMap&& actionPacks) :
-        handlers(std::move(firmwares)),
-        blobIDs(blobs), transports(std::move(transports)),
-        activeImage(activeImageBlobId), activeHash(activeHashBlobId),
-        verifyImage(verifyBlobId), updateImage(updateBlobId), lookup(),
-        state(UpdateState::notYetStarted), actionPacks(std::move(actionPacks))
+        handlers(std::move(firmwares)), blobIDs(blobs),
+        transports(std::move(transports)), activeImage(activeImageBlobId),
+        activeHash(activeHashBlobId), verifyImage(verifyBlobId),
+        updateImage(updateBlobId), lookup(), state(UpdateState::notYetStarted),
+        actionPacks(std::move(actionPacks))
     {}
     ~FirmwareBlobHandler() = default;
     FirmwareBlobHandler(const FirmwareBlobHandler&) = delete;
diff --git a/bmc/firmware-handler/firmware_handlers_builder.cpp b/bmc/firmware-handler/firmware_handlers_builder.cpp
index 13bfd69..c803997 100644
--- a/bmc/firmware-handler/firmware_handlers_builder.cpp
+++ b/bmc/firmware-handler/firmware_handlers_builder.cpp
@@ -49,9 +49,9 @@
             /* name must be: /flash/... */
             if (!std::regex_match(output.blobId, std::regex("^\\/flash\\/.+")))
             {
-                throw std::runtime_error("Invalid blob name: '" +
-                                         output.blobId +
-                                         "' must start with /flash/");
+                throw std::runtime_error(
+                    "Invalid blob name: '" + output.blobId +
+                    "' must start with /flash/");
             }
 
             /* handler is required. */
@@ -64,8 +64,8 @@
             }
             else
             {
-                throw std::runtime_error("Invalid handler type: " +
-                                         handlerType);
+                throw std::runtime_error(
+                    "Invalid handler type: " + handlerType);
             }
 
             /* actions are required (presently). */
@@ -85,8 +85,8 @@
             }
             else
             {
-                throw std::runtime_error("Invalid preparation type: " +
-                                         prepareType);
+                throw std::runtime_error(
+                    "Invalid preparation type: " + prepareType);
             }
 
             const auto& verify = a.at("verification");
@@ -105,8 +105,8 @@
             }
             else
             {
-                throw std::runtime_error("Invalid verification type:" +
-                                         verifyType);
+                throw std::runtime_error(
+                    "Invalid verification type:" + verifyType);
             }
 
             const auto& update = a.at("update");
diff --git a/bmc/firmware-handler/lpc_aspeed.cpp b/bmc/firmware-handler/lpc_aspeed.cpp
index 047f87b..888e0af 100644
--- a/bmc/firmware-handler/lpc_aspeed.cpp
+++ b/bmc/firmware-handler/lpc_aspeed.cpp
@@ -35,9 +35,8 @@
 
 const std::string LpcMapperAspeed::lpcControlPath = "/dev/aspeed-lpc-ctrl";
 
-std::unique_ptr<HardwareMapperInterface>
-    LpcMapperAspeed::createAspeedMapper(std::uint32_t regionAddress,
-                                        std::size_t regionSize)
+std::unique_ptr<HardwareMapperInterface> LpcMapperAspeed::createAspeedMapper(
+    std::uint32_t regionAddress, std::size_t regionSize)
 {
     /* NOTE: considered using a joint factory to create one or the other, for
      * now, separate factories.
diff --git a/bmc/firmware-handler/lpc_aspeed.hpp b/bmc/firmware-handler/lpc_aspeed.hpp
index ac87c22..1a547c9 100644
--- a/bmc/firmware-handler/lpc_aspeed.hpp
+++ b/bmc/firmware-handler/lpc_aspeed.hpp
@@ -23,8 +23,7 @@
      */
     LpcMapperAspeed(std::uint32_t regionAddress, std::size_t regionSize,
                     const internal::Sys* sys = &internal::sys_impl) :
-        regionAddress(regionAddress),
-        regionSize(regionSize), sys(sys){};
+        regionAddress(regionAddress), regionSize(regionSize), sys(sys) {};
 
     LpcMapperAspeed(const LpcMapperAspeed&) = delete;
     LpcMapperAspeed& operator=(const LpcMapperAspeed&) = delete;
diff --git a/bmc/firmware-handler/lpc_nuvoton.cpp b/bmc/firmware-handler/lpc_nuvoton.cpp
index eaa316f..dcf9eaa 100644
--- a/bmc/firmware-handler/lpc_nuvoton.cpp
+++ b/bmc/firmware-handler/lpc_nuvoton.cpp
@@ -36,9 +36,8 @@
 using std::uint32_t;
 using std::uint8_t;
 
-std::unique_ptr<HardwareMapperInterface>
-    LpcMapperNuvoton::createNuvotonMapper(std::uint32_t regionAddress,
-                                          std::uint32_t regionSize)
+std::unique_ptr<HardwareMapperInterface> LpcMapperNuvoton::createNuvotonMapper(
+    std::uint32_t regionAddress, std::uint32_t regionSize)
 {
     /* NOTE: Considered making one factory for both types. */
     return std::make_unique<LpcMapperNuvoton>(regionAddress, regionSize);
@@ -98,8 +97,8 @@
  *   - WindowOffset = 4 and WindowSize = len - 4 if (addr & 0x7) == 0
  *   - WindowSize = 0 means that the region cannot be mapped otherwise
  */
-WindowMapResult LpcMapperNuvoton::mapWindow(std::uint32_t address,
-                                            std::uint32_t length)
+WindowMapResult
+    LpcMapperNuvoton::mapWindow(std::uint32_t address, std::uint32_t length)
 {
     WindowMapResult result = {};
 
diff --git a/bmc/firmware-handler/lpc_nuvoton.hpp b/bmc/firmware-handler/lpc_nuvoton.hpp
index c66653b..9aa5b8b 100644
--- a/bmc/firmware-handler/lpc_nuvoton.hpp
+++ b/bmc/firmware-handler/lpc_nuvoton.hpp
@@ -14,9 +14,8 @@
 class LpcMapperNuvoton : public HardwareMapperInterface
 {
   public:
-    static std::unique_ptr<HardwareMapperInterface>
-        createNuvotonMapper(std::uint32_t regionAddress,
-                            std::uint32_t regionSize);
+    static std::unique_ptr<HardwareMapperInterface> createNuvotonMapper(
+        std::uint32_t regionAddress, std::uint32_t regionSize);
 
     /**
      * Create an LpcMapper for Nuvoton.
@@ -28,8 +27,7 @@
      */
     LpcMapperNuvoton(std::uint32_t regionAddress, std::uint32_t regionSize,
                      const internal::Sys* sys = &internal::sys_impl) :
-        regionAddress(regionAddress),
-        memoryRegionSize(regionSize), sys(sys){};
+        regionAddress(regionAddress), memoryRegionSize(regionSize), sys(sys) {};
 
     /** Attempt to map the window for copying bytes, after mapWindow is called.
      * throws MapperException
diff --git a/bmc/firmware-handler/pci_handler.hpp b/bmc/firmware-handler/pci_handler.hpp
index 9b2c5b6..848760c 100644
--- a/bmc/firmware-handler/pci_handler.hpp
+++ b/bmc/firmware-handler/pci_handler.hpp
@@ -20,8 +20,7 @@
   public:
     PciDataHandler(std::uint32_t regionAddress, std::size_t regionSize,
                    const internal::Sys* sys = &internal::sys_impl) :
-        regionAddress(regionAddress),
-        memoryRegionSize(regionSize), sys(sys){};
+        regionAddress(regionAddress), memoryRegionSize(regionSize), sys(sys) {};
 
     bool open() override;
     bool close() override;
diff --git a/bmc/firmware-handler/test/firmware_state_verificationstarted_unittest.cpp b/bmc/firmware-handler/test/firmware_state_verificationstarted_unittest.cpp
index 4f69c89..ab2de9e 100644
--- a/bmc/firmware-handler/test/firmware_state_verificationstarted_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_state_verificationstarted_unittest.cpp
@@ -52,9 +52,9 @@
     getToVerificationStarted(staticLayoutBlobId);
 
     auto blobs = handler->getBlobIds();
-    EXPECT_THAT(
-        blobs, UnorderedElementsAreArray({activeImageBlobId, staticLayoutBlobId,
-                                          hashBlobId, verifyBlobId}));
+    EXPECT_THAT(blobs, UnorderedElementsAreArray(
+                           {activeImageBlobId, staticLayoutBlobId, hashBlobId,
+                            verifyBlobId}));
 
     for (const auto& blob : blobs)
     {
diff --git a/bmc/general_systemd.cpp b/bmc/general_systemd.cpp
index 02c3aea..ce16d14 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/general_systemd.hpp b/bmc/general_systemd.hpp
index 4df4747..48e5177 100644
--- a/bmc/general_systemd.hpp
+++ b/bmc/general_systemd.hpp
@@ -20,8 +20,7 @@
 
     SystemdNoFile(sdbusplus::bus_t&& bus, const std::string& service,
                   const std::string& mode) :
-        bus(std::move(bus)),
-        triggerService(service), mode(mode)
+        bus(std::move(bus)), triggerService(service), mode(mode)
     {}
 
     SystemdNoFile(const SystemdNoFile&) = delete;
@@ -66,15 +65,13 @@
      * @param[in] mode - the job-mode when starting the systemd Unit.
      */
     static std::unique_ptr<TriggerableActionInterface>
-        CreateSystemdWithStatusFile(sdbusplus::bus_t&& bus,
-                                    const std::string& path,
-                                    const std::string& service,
-                                    const std::string& mode);
+        CreateSystemdWithStatusFile(
+            sdbusplus::bus_t&& bus, const std::string& path,
+            const std::string& service, const std::string& mode);
 
     SystemdWithStatusFile(sdbusplus::bus_t&& bus, const std::string& path,
                           const std::string& service, const std::string& mode) :
-        SystemdNoFile(std::move(bus), service, mode),
-        checkPath(path)
+        SystemdNoFile(std::move(bus), service, mode), checkPath(path)
     {}
 
     bool trigger() override;
diff --git a/bmc/image_handler.hpp b/bmc/image_handler.hpp
index 4d5b475..59944c6 100644
--- a/bmc/image_handler.hpp
+++ b/bmc/image_handler.hpp
@@ -66,8 +66,7 @@
   public:
     HandlerPack(const std::string& name,
                 std::unique_ptr<ImageHandlerInterface> handler) :
-        blobName(name),
-        handler(std::move(handler))
+        blobName(name), handler(std::move(handler))
     {}
 
     HandlerPack() = default;
diff --git a/bmc/log-handler/log_handler.cpp b/bmc/log-handler/log_handler.cpp
index 9a0d296..de91ae4 100644
--- a/bmc/log-handler/log_handler.cpp
+++ b/bmc/log-handler/log_handler.cpp
@@ -36,41 +36,44 @@
         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
-            {
-                if (tai.status() != ActionStatus::success)
+                auto data =
+                    std::make_shared<std::optional<std::vector<uint8_t>>>();
+                do
                 {
-                    fprintf(stderr,
-                            "LogBlobHandler: Log file unit failed for %s\n",
-                            infoP->blobId.c_str());
-                    continue;
-                }
-                if (!infoP->handler->open("", std::ios::in))
-                {
-                    fprintf(stderr,
+                    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,
                             "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;
+                        continue;
+                    }
+                    *data = std::move(d);
+                } while (false);
+                for (auto sessionP : infoP->sessionsToUpdate)
+                {
+                    sessionP->data = data;
                 }
-                *data = std::move(d);
-            } while (false);
-            for (auto sessionP : infoP->sessionsToUpdate)
-            {
-                sessionP->data = data;
-            }
-            infoP->sessionsToUpdate.clear();
-        });
+                infoP->sessionsToUpdate.clear();
+            });
         if (!blobInfoMap.try_emplace(info->blobId, std::move(info)).second)
         {
             fprintf(stderr,
diff --git a/bmc/log-handler/log_handlers_builder.cpp b/bmc/log-handler/log_handlers_builder.cpp
index d9c7fb2..fe60cce 100644
--- a/bmc/log-handler/log_handlers_builder.cpp
+++ b/bmc/log-handler/log_handlers_builder.cpp
@@ -64,8 +64,8 @@
             }
             else
             {
-                throw std::runtime_error("Invalid handler type: " +
-                                         handlerType);
+                throw std::runtime_error(
+                    "Invalid handler type: " + handlerType);
             }
 
             /* actions are required (presently). */
@@ -85,8 +85,8 @@
             }
             else
             {
-                throw std::runtime_error("Invalid preparation type: " +
-                                         onOpenType);
+                throw std::runtime_error(
+                    "Invalid preparation type: " + onOpenType);
             }
 
             const auto& onDelete = a.at("delete");
@@ -101,8 +101,8 @@
             }
             else
             {
-                throw std::runtime_error("Invalid preparation type: " +
-                                         onDeleteType);
+                throw std::runtime_error(
+                    "Invalid preparation type: " + onDeleteType);
             }
 
             output.actions = std::move(pack);
diff --git a/bmc/version-handler/test/version_mock.hpp b/bmc/version-handler/test/version_mock.hpp
index d8035a5..71fabaf 100644
--- a/bmc/version-handler/test/version_mock.hpp
+++ b/bmc/version-handler/test/version_mock.hpp
@@ -9,10 +9,9 @@
 namespace ipmi_flash
 {
 
-static HandlerConfig<VersionBlobHandler::ActionPack>
-    createMockVersionConfig(const std::string& id,
-                            ImageHandlerMock** im = nullptr,
-                            TriggerMock** tm = nullptr)
+static HandlerConfig<VersionBlobHandler::ActionPack> createMockVersionConfig(
+    const std::string& id, ImageHandlerMock** im = nullptr,
+    TriggerMock** tm = nullptr)
 {
     HandlerConfig<VersionBlobHandler::ActionPack> ret;
     ret.blobId = id;
diff --git a/bmc/version-handler/version_handler.cpp b/bmc/version-handler/version_handler.cpp
index f26884b..5b285f8 100644
--- a/bmc/version-handler/version_handler.cpp
+++ b/bmc/version-handler/version_handler.cpp
@@ -23,38 +23,39 @@
         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
-            {
-                if (tai.status() != ActionStatus::success)
+                auto data =
+                    std::make_shared<std::optional<std::vector<uint8_t>>>();
+                do
                 {
-                    fprintf(stderr, "Version file unit failed for %s\n",
-                            infoP->blobId.c_str());
-                    continue;
-                }
-                if (!infoP->handler->open("", std::ios::in))
+                    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)
                 {
-                    fprintf(stderr, "Opening version file failed for %s\n",
-                            infoP->blobId.c_str());
-                    continue;
+                    sessionP->data = data;
                 }
-                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();
-        });
+                infoP->sessionsToUpdate.clear();
+            });
         if (!blobInfoMap.try_emplace(info->blobId, std::move(info)).second)
         {
             fprintf(stderr, "Ignoring duplicate config for %s\n",
diff --git a/bmc/version-handler/version_handlers_builder.cpp b/bmc/version-handler/version_handlers_builder.cpp
index 044f4e3..d0b7360 100644
--- a/bmc/version-handler/version_handlers_builder.cpp
+++ b/bmc/version-handler/version_handlers_builder.cpp
@@ -75,8 +75,8 @@
             }
             else
             {
-                throw std::runtime_error("Invalid handler type: " +
-                                         handlerType);
+                throw std::runtime_error(
+                    "Invalid handler type: " + handlerType);
             }
 
             /* actions are required (presently). */
@@ -96,8 +96,8 @@
             }
             else
             {
-                throw std::runtime_error("Invalid preparation type: " +
-                                         onOpenType);
+                throw std::runtime_error(
+                    "Invalid preparation type: " + onOpenType);
             }
 
             output.actions = std::move(pack);
diff --git a/cleanup/cleanup.hpp b/cleanup/cleanup.hpp
index 04e2d94..5073d46 100644
--- a/cleanup/cleanup.hpp
+++ b/cleanup/cleanup.hpp
@@ -14,16 +14,14 @@
 class FileCleanupHandler : public blobs::GenericBlobInterface
 {
   public:
-    static std::unique_ptr<blobs::GenericBlobInterface>
-        CreateCleanupHandler(const std::string& blobId,
-                             const std::vector<std::string>& files,
-                             std::unique_ptr<FileSystemInterface> helper);
+    static std::unique_ptr<blobs::GenericBlobInterface> CreateCleanupHandler(
+        const std::string& blobId, const std::vector<std::string>& files,
+        std::unique_ptr<FileSystemInterface> helper);
 
     FileCleanupHandler(const std::string& blobId,
                        const std::vector<std::string>& files,
                        std::unique_ptr<FileSystemInterface> helper) :
-        supported(blobId),
-        files(files), helper(std::move(helper))
+        supported(blobId), files(files), helper(std::move(helper))
     {}
 
     ~FileCleanupHandler() = default;
diff --git a/tools/bt.hpp b/tools/bt.hpp
index 16605fd..fd0a8cc 100644
--- a/tools/bt.hpp
+++ b/tools/bt.hpp
@@ -14,8 +14,7 @@
   public:
     BtDataHandler(ipmiblob::BlobInterface* blob, ProgressInterface* progress,
                   const internal::Sys* sys = &internal::sys_impl) :
-        blob(blob),
-        progress(progress), sys(sys){};
+        blob(blob), progress(progress), sys(sys) {};
 
     bool sendContents(const std::string& input, std::uint16_t session) override;
     ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const override
diff --git a/tools/handler.cpp b/tools/handler.cpp
index c3fa30c..55503b9 100644
--- a/tools/handler.cpp
+++ b/tools/handler.cpp
@@ -53,15 +53,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());
@@ -84,8 +84,8 @@
         }
         catch (const ipmiblob::BlobException& b)
         {
-            throw ToolException("blob exception received: " +
-                                std::string(b.what()));
+            throw ToolException(
+                "blob exception received: " + std::string(b.what()));
         }
         catch (const ToolException& t)
         {
@@ -185,8 +185,9 @@
 
 std::vector<uint8_t> UpdateHandler::readVersion(const std::string& versionBlob)
 {
-    return retryIfFailed(
-        [this, versionBlob]() { return retryReadVersion(versionBlob); });
+    return retryIfFailed([this, versionBlob]() {
+        return retryReadVersion(versionBlob);
+    });
 }
 
 void UpdateHandler::cleanArtifacts()
diff --git a/tools/helper.cpp b/tools/helper.cpp
index f419410..34fab4f 100644
--- a/tools/helper.cpp
+++ b/tools/helper.cpp
@@ -80,8 +80,8 @@
     }
     catch (const ipmiblob::BlobException& b)
     {
-        throw ToolException("blob exception received: " +
-                            std::string(b.what()));
+        throw ToolException(
+            "blob exception received: " + std::string(b.what()));
     }
 }
 
@@ -92,24 +92,25 @@
 {
     pollStat(session, blob,
              [](const ipmiblob::StatResponse& resp) -> std::optional<bool> {
-        if (resp.metadata.size() != 1)
-        {
-            throw ToolException("Invalid stat metadata");
-        }
-        auto result = static_cast<ipmi_flash::ActionStatus>(resp.metadata[0]);
-        switch (result)
-        {
-            case ipmi_flash::ActionStatus::failed:
-                throw ToolException("BMC reported failure");
-            case ipmi_flash::ActionStatus::unknown:
-            case ipmi_flash::ActionStatus::running:
-                return std::nullopt;
-            case ipmi_flash::ActionStatus::success:
-                return true;
-            default:
-                throw ToolException("Unrecognized action status");
-        }
-    });
+                 if (resp.metadata.size() != 1)
+                 {
+                     throw ToolException("Invalid stat metadata");
+                 }
+                 auto result =
+                     static_cast<ipmi_flash::ActionStatus>(resp.metadata[0]);
+                 switch (result)
+                 {
+                     case ipmi_flash::ActionStatus::failed:
+                         throw ToolException("BMC reported failure");
+                     case ipmi_flash::ActionStatus::unknown:
+                     case ipmi_flash::ActionStatus::running:
+                         return std::nullopt;
+                     case ipmi_flash::ActionStatus::success:
+                         return true;
+                     default:
+                         throw ToolException("Unrecognized action status");
+                 }
+             });
 }
 
 /* Poll an open blob session for reading.
@@ -131,16 +132,16 @@
     return pollStat(
         session, blob,
         [](const ipmiblob::StatResponse& resp) -> std::optional<uint32_t> {
-        if (resp.blob_state & ipmiblob::StateFlags::open_read)
-        {
-            return resp.size;
-        }
-        if (resp.blob_state & ipmiblob::StateFlags::committing)
-        {
-            return std::nullopt;
-        }
-        throw ToolException("BMC blob failed to become ready");
-    });
+            if (resp.blob_state & ipmiblob::StateFlags::open_read)
+            {
+                return resp.size;
+            }
+            if (resp.blob_state & ipmiblob::StateFlags::committing)
+            {
+                return std::nullopt;
+            }
+            throw ToolException("BMC blob failed to become ready");
+        });
 }
 
 void* memcpyAligned(void* destination, const void* source, std::size_t size)
diff --git a/tools/io.cpp b/tools/io.cpp
index c84a8b3..9af8ace 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/io.hpp b/tools/io.hpp
index 8925418..7301e5f 100644
--- a/tools/io.hpp
+++ b/tools/io.hpp
@@ -42,8 +42,7 @@
   public:
     explicit PpcMemDevice(const std::string& ppcMemPath,
                           const internal::Sys* sys = &internal::sys_impl) :
-        ppcMemPath(ppcMemPath),
-        sys(sys)
+        ppcMemPath(ppcMemPath), sys(sys)
     {}
 
     ~PpcMemDevice() override;
diff --git a/tools/lpc.cpp b/tools/lpc.cpp
index e415331..c7f4013 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/lpc.hpp b/tools/lpc.hpp
index 1786c94..2fe7e08 100644
--- a/tools/lpc.hpp
+++ b/tools/lpc.hpp
@@ -27,9 +27,8 @@
                    std::uint32_t address, std::uint32_t length,
                    ProgressInterface* progress,
                    const internal::Sys* sys = &internal::sys_impl) :
-        blob(blob),
-        io(io), address(address), length(length), progress(progress),
-        sys(sys){};
+        blob(blob), io(io), address(address), length(length),
+        progress(progress), sys(sys) {};
 
     bool sendContents(const std::string& input, std::uint16_t session) override;
     ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const override
diff --git a/tools/main.cpp b/tools/main.cpp
index 5bda3a0..c6ce451 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)
         {
@@ -252,8 +252,8 @@
         else if (interface == IPMIPCI)
         {
             auto& pci = host_tool::PciAccessImpl::getInstance();
-            handler = std::make_unique<host_tool::P2aDataHandler>(&blob, &pci,
-                                                                  &progress);
+            handler = std::make_unique<host_tool::P2aDataHandler>(
+                &blob, &pci, &progress);
         }
         else if (interface == IPMIPCI_SKIP_BRIDGE_DISABLE)
         {
diff --git a/tools/net.hpp b/tools/net.hpp
index 7578c82..3a41ff5 100644
--- a/tools/net.hpp
+++ b/tools/net.hpp
@@ -21,8 +21,7 @@
     NetDataHandler(ipmiblob::BlobInterface* blob, ProgressInterface* progress,
                    const std::string& host, const std::string& port,
                    const internal::Sys* sys = &internal::sys_impl) :
-        blob(blob),
-        progress(progress), host(host), port(port), sys(sys){};
+        blob(blob), progress(progress), host(host), port(port), sys(sys) {};
 
     bool sendContents(const std::string& input, std::uint16_t session) override;
     ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const override
diff --git a/tools/p2a.hpp b/tools/p2a.hpp
index 259ca23..8882ac4 100644
--- a/tools/p2a.hpp
+++ b/tools/p2a.hpp
@@ -19,9 +19,8 @@
     explicit P2aDataHandler(ipmiblob::BlobInterface* blob, const PciAccess* pci,
                             ProgressInterface* progress, bool skipBridgeDisable,
                             const internal::Sys* sys = &internal::sys_impl) :
-        blob(blob),
-        pci(pci), progress(progress), skipBridgeDisable(skipBridgeDisable),
-        sys(sys)
+        blob(blob), pci(pci), progress(progress),
+        skipBridgeDisable(skipBridgeDisable), sys(sys)
     {}
 
     P2aDataHandler(ipmiblob::BlobInterface* blob, const PciAccess* pci,
diff --git a/tools/pci.cpp b/tools/pci.cpp
index a6bc74d..516bbad 100644
--- a/tools/pci.cpp
+++ b/tools/pci.cpp
@@ -52,8 +52,7 @@
 PciAccessBridge::PciAccessBridge(const struct pci_id_match* match, int bar,
                                  std::size_t dataOffset, std::size_t dataLength,
                                  const PciAccess* pci) :
-    dataOffset(dataOffset),
-    dataLength(dataLength), pci(pci)
+    dataOffset(dataOffset), dataLength(dataLength), pci(pci)
 {
     It it(pci->pci_id_match_iterator_create(match), pci);
 
diff --git a/tools/pci.hpp b/tools/pci.hpp
index c13a4e1..9f72e78 100644
--- a/tools/pci.hpp
+++ b/tools/pci.hpp
@@ -51,7 +51,7 @@
     virtual ~PciAccessBridge();
 
     virtual void write(const std::span<const std::uint8_t> data) override;
-    virtual void configure(const ipmi_flash::PciConfigResponse&) override{};
+    virtual void configure(const ipmi_flash::PciConfigResponse&) override {};
 
     std::size_t getDataLength() override
     {
diff --git a/tools/pciaccess.cpp b/tools/pciaccess.cpp
index e5b9a2f..f3c9e6e 100644
--- a/tools/pciaccess.cpp
+++ b/tools/pciaccess.cpp
@@ -50,16 +50,14 @@
     return ::pci_device_probe(dev);
 }
 
-int PciAccessImpl::pci_device_cfg_read_u8(struct pci_device* dev,
-                                          std::uint8_t* data,
-                                          pciaddr_t offset) const
+int PciAccessImpl::pci_device_cfg_read_u8(
+    struct pci_device* dev, std::uint8_t* data, pciaddr_t offset) const
 {
     return ::pci_device_cfg_read_u8(dev, data, offset);
 }
 
-int PciAccessImpl::pci_device_cfg_write_u8(struct pci_device* dev,
-                                           std::uint8_t data,
-                                           pciaddr_t offset) const
+int PciAccessImpl::pci_device_cfg_write_u8(
+    struct pci_device* dev, std::uint8_t data, pciaddr_t offset) const
 {
     return ::pci_device_cfg_write_u8(dev, data, offset);
 }
diff --git a/tools/pciaccess.hpp b/tools/pciaccess.hpp
index 23fc4ab..99ba265 100644
--- a/tools/pciaccess.hpp
+++ b/tools/pciaccess.hpp
@@ -41,12 +41,10 @@
     virtual struct pci_device*
         pci_device_next(struct pci_device_iterator* iter) const = 0;
     virtual int pci_device_probe(struct pci_device* dev) const = 0;
-    virtual int pci_device_cfg_read_u8(struct pci_device* dev,
-                                       std::uint8_t* data,
-                                       pciaddr_t offset) const = 0;
-    virtual int pci_device_cfg_write_u8(struct pci_device* dev,
-                                        std::uint8_t data,
-                                        pciaddr_t offset) const = 0;
+    virtual int pci_device_cfg_read_u8(
+        struct pci_device* dev, std::uint8_t* data, pciaddr_t offset) const = 0;
+    virtual int pci_device_cfg_write_u8(
+        struct pci_device* dev, std::uint8_t data, pciaddr_t offset) const = 0;
     virtual int pci_device_map_range(struct pci_device* dev, pciaddr_t base,
                                      pciaddr_t size, unsigned map_flags,
                                      void** addr) const = 0;
diff --git a/tools/test/tools_bt_unittest.cpp b/tools/test/tools_bt_unittest.cpp
index e1a091b..3d2c181 100644
--- a/tools/test/tools_bt_unittest.cpp
+++ b/tools/test/tools_bt_unittest.cpp
@@ -58,10 +58,11 @@
 
     EXPECT_CALL(sysMock, read(fd, NotNull(), _))
         .WillOnce(Invoke([&](int, void* buf, std::size_t count) {
-        EXPECT_TRUE(count > bytes.size());
-        std::memcpy(buf, bytes.data(), bytes.size());
-        return bytes.size();
-    })).WillOnce(Return(0));
+            EXPECT_TRUE(count > bytes.size());
+            std::memcpy(buf, bytes.data(), bytes.size());
+            return bytes.size();
+        }))
+        .WillOnce(Return(0));
 
     EXPECT_CALL(progMock, updateProgress(bytes.size()));
 
@@ -99,10 +100,10 @@
 
     EXPECT_CALL(sysMock, read(fd, NotNull(), _))
         .WillOnce(Invoke([&](int, void* buf, std::size_t count) {
-        EXPECT_TRUE(count > bytes.size());
-        std::memcpy(buf, bytes.data(), bytes.size());
-        return bytes.size();
-    }));
+            EXPECT_TRUE(count > bytes.size());
+            std::memcpy(buf, bytes.data(), bytes.size());
+            return bytes.size();
+        }));
 
     EXPECT_CALL(blobMock, writeBytes(session, 0, ContainerEq(bytes)))
         .WillOnce(Throw(ipmiblob::BlobException("failure")));
diff --git a/tools/test/tools_helper_unittest.cpp b/tools/test/tools_helper_unittest.cpp
index 572e136..cfe5208 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_lpc_unittest.cpp b/tools/test/tools_lpc_unittest.cpp
index 2ecbaf0..b180df5 100644
--- a/tools/test/tools_lpc_unittest.cpp
+++ b/tools/test/tools_lpc_unittest.cpp
@@ -56,16 +56,17 @@
         .WillOnce(Return(fakeFileSize));
     EXPECT_CALL(sysMock, read(_, NotNull(), Gt(data.size())))
         .WillOnce(Invoke([&data](int, void* buf, std::size_t) {
-        std::memcpy(buf, data.data(), data.size());
-        return data.size();
-    })).WillOnce(Return(0));
+            std::memcpy(buf, data.data(), data.size());
+            return data.size();
+        }))
+        .WillOnce(Return(0));
 
     EXPECT_CALL(ioMock, write(_, data.size(), _))
         .WillOnce(Invoke([&data](const std::size_t, const std::size_t,
                                  const void* const source) {
-        EXPECT_THAT(std::memcmp(source, data.data(), data.size()), 0);
-        return true;
-    }));
+            EXPECT_THAT(std::memcmp(source, data.data(), data.size()), 0);
+            return true;
+        }));
 
     EXPECT_CALL(blobMock, writeBytes(session, 0, _));
 
diff --git a/tools/test/tools_net_unittest.cpp b/tools/test/tools_net_unittest.cpp
index cb8776f..8c88ba9 100644
--- a/tools/test/tools_net_unittest.cpp
+++ b/tools/test/tools_net_unittest.cpp
@@ -134,9 +134,9 @@
     EXPECT_CALL(sysMock, socket(AF_INET6, SOCK_STREAM, 0))
         .WillOnce(Return(connFd));
     EXPECT_CALL(sysMock, close(connFd)).WillOnce(Return(0));
-    EXPECT_CALL(
-        sysMock,
-        connect(connFd, reinterpret_cast<struct sockaddr*>(&sa), sizeof(sa)))
+    EXPECT_CALL(sysMock,
+                connect(connFd, reinterpret_cast<struct sockaddr*>(&sa),
+                        sizeof(sa)))
         .WillOnce(SetErrnoAndReturn(ECONNREFUSED, -1));
 
     EXPECT_FALSE(handler.sendContents(filePath, session));
@@ -232,9 +232,9 @@
         InSequence seq;
         EXPECT_CALL(sysMock, sendfile(connFd, inFd, _, _))
             .WillOnce([](int, int, off_t*, size_t) {
-            errno = EINVAL;
-            return -1;
-        });
+                errno = EINVAL;
+                return -1;
+            });
 
         std::vector<uint8_t> chunk(chunkSize);
         for (std::uint32_t offset = 0; offset < fakeFileSize;
@@ -246,16 +246,16 @@
             }
             EXPECT_CALL(sysMock, read(inFd, _, Ge(chunkSize)))
                 .WillOnce([chunk](int, void* buf, size_t) {
-                memcpy(buf, chunk.data(), chunkSize);
-                return chunkSize;
-            });
+                    memcpy(buf, chunk.data(), chunkSize);
+                    return chunkSize;
+                });
             EXPECT_CALL(sysMock, send(connFd, _, chunkSize, 0))
                 .WillOnce([chunk](int, const void* data, size_t len, int) {
-                std::vector<uint8_t> dcopy(len);
-                memcpy(dcopy.data(), data, len);
-                EXPECT_THAT(dcopy, ContainerEq(chunk));
-                return chunkSize;
-            });
+                    std::vector<uint8_t> dcopy(len);
+                    memcpy(dcopy.data(), data, len);
+                    EXPECT_THAT(dcopy, ContainerEq(chunk));
+                    return chunkSize;
+                });
             EXPECT_CALL(blobMock,
                         writeBytes(session, offset, ContainerEq(chunkBytes)));
             EXPECT_CALL(progMock, updateProgress(chunkSize));
diff --git a/tools/test/tools_pci_unittest.cpp b/tools/test/tools_pci_unittest.cpp
index 96a204a..c3ce610 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 acaaee7..fd795ee 100644
--- a/tools/test/tools_updater_unittest.cpp
+++ b/tools/test/tools_updater_unittest.cpp
@@ -235,8 +235,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));
@@ -253,8 +253,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));
@@ -288,8 +288,8 @@
         .Times(3)
         .WillRepeatedly(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)))
         .Times(3)
diff --git a/tools/tool_errors.hpp b/tools/tool_errors.hpp
index 96dfa10..3b614f9 100644
--- a/tools/tool_errors.hpp
+++ b/tools/tool_errors.hpp
@@ -9,7 +9,7 @@
 class ToolException : public std::exception
 {
   public:
-    explicit ToolException(const std::string& message) : message(message){};
+    explicit ToolException(const std::string& message) : message(message) {};
 
     virtual const char* what() const noexcept override
     {
@@ -24,7 +24,7 @@
 {
   public:
     explicit NotFoundException(const std::string& device) :
-        ToolException(std::string("Couldn't find " + device)){};
+        ToolException(std::string("Couldn't find " + device)) {};
 };
 
 } // namespace host_tool
