diff --git a/.clang-format b/.clang-format
index 79a474d..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,6 +38,7 @@
   SplitEmptyFunction:   false
   SplitEmptyRecord:     false
   SplitEmptyNamespace:  false
+BreakAfterAttributes: Never
 BreakBeforeBinaryOperators: None
 BreakBeforeBraces: Custom
 BreakBeforeTernaryOperators: true
@@ -75,9 +78,13 @@
   - Regex:           '.*'
     Priority:        6
 IndentCaseLabels: true
+IndentRequiresClause: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
+InsertNewlineAtEOF: true
 KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
 MaxEmptyLinesToKeep: 1
@@ -85,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
@@ -111,6 +124,6 @@
 SpacesInSquareBrackets: false
 Standard:        Latest
 TabWidth:        4
-UseCRLF: false
 UseTab:          Never
 ...
+
diff --git a/command/channel_auth.cpp b/command/channel_auth.cpp
index 44d5cad..3308bf6 100644
--- a/command/channel_auth.cpp
+++ b/command/channel_auth.cpp
@@ -225,8 +225,8 @@
     static std::vector<uint8_t> supportedAlgorithms;
     static bool recordInit = false;
 
-    uint8_t rspChannel =
-        ipmi::convertCurrentChannelNum(channelNumber, getInterfaceIndex());
+    uint8_t rspChannel = ipmi::convertCurrentChannelNum(channelNumber,
+                                                        getInterfaceIndex());
 
     if (!ipmi::isValidChannel(rspChannel))
     {
@@ -253,8 +253,8 @@
         }
     }
 
-    const std::vector<uint8_t>& records =
-        algoSelectBit ? cipherRecords : supportedAlgorithms;
+    const std::vector<uint8_t>& records = algoSelectBit ? cipherRecords
+                                                        : supportedAlgorithms;
     static constexpr auto respSize = 16;
 
     // Session support is available in active LAN channels.
@@ -271,8 +271,8 @@
     // set of 16 and so on.
 
     // Calculate the number of record data bytes to be returned.
-    auto start =
-        std::min(static_cast<size_t>(listIndex) * respSize, records.size());
+    auto start = std::min(static_cast<size_t>(listIndex) * respSize,
+                          records.size());
     auto end = std::min((static_cast<size_t>(listIndex) * respSize) + respSize,
                         records.size());
     auto size = end - start;
diff --git a/command/channel_auth.hpp b/command/channel_auth.hpp
index c518ba7..a1f9af7 100644
--- a/command/channel_auth.hpp
+++ b/command/channel_auth.hpp
@@ -27,7 +27,7 @@
 {
     uint8_t completionCode; // Completion Code
 
-    uint8_t channelNumber; // Channel number that the request was
+    uint8_t channelNumber;  // Channel number that the request was
     // received on
 
 #if BYTE_ORDER == LITTLE_ENDIAN
diff --git a/command/guid.cpp b/command/guid.cpp
index 253a2dc..5d6c07a 100644
--- a/command/guid.cpp
+++ b/command/guid.cpp
@@ -73,8 +73,8 @@
         for (size_t iter = 0, inc = 0; iter < len && inc < BMC_GUID_LEN;
              iter += 2, inc++)
         {
-            uint8_t hexVal =
-                std::strtoul(readUUID.substr(iter, 2).c_str(), NULL, 16);
+            uint8_t hexVal = std::strtoul(readUUID.substr(iter, 2).c_str(),
+                                          NULL, 16);
             guid[inc] = hexVal;
         }
     } while (0);
diff --git a/command/payload_cmds.hpp b/command/payload_cmds.hpp
index 8778786..bbd220a 100644
--- a/command/payload_cmds.hpp
+++ b/command/payload_cmds.hpp
@@ -194,7 +194,7 @@
 {
     uint8_t completionCode; //!< Completion code.
 
-    uint8_t capacity; //!< Instance capacity.
+    uint8_t capacity;       //!< Instance capacity.
 
     /* @brief Activation Status. */
 #if BYTE_ORDER == LITTLE_ENDIAN
diff --git a/command/rakp12.cpp b/command/rakp12.cpp
index bcdcc35..a6b4f85 100644
--- a/command/rakp12.cpp
+++ b/command/rakp12.cpp
@@ -75,8 +75,8 @@
         return outPayload;
     }
 
-    auto rakp1Size =
-        sizeof(RAKP1request) - (userNameMaxLen - request->user_name_len);
+    auto rakp1Size = sizeof(RAKP1request) -
+                     (userNameMaxLen - request->user_name_len);
 
     std::string message = "Invalid login attempted via RCMPP interface ";
     // Validate user name length in the message
diff --git a/command/session_cmds.cpp b/command/session_cmds.cpp
index 1405b6b..1a7c266 100644
--- a/command/session_cmds.cpp
+++ b/command/session_cmds.cpp
@@ -153,10 +153,10 @@
 
                 auto itr = serviceMap.begin();
                 const std::string service = itr->first;
-                uint8_t closeSessionPriv =
-                    std::get<uint8_t>(ipmi::getDbusProperty(
-                        *busp, service, obj, session::sessionIntf,
-                        "CurrentPrivilege"));
+                uint8_t closeSessionPriv = std::get<uint8_t>(
+                    ipmi::getDbusProperty(*busp, service, obj,
+                                          session::sessionIntf,
+                                          "CurrentPrivilege"));
 
                 if (currentSessionPriv < closeSessionPriv)
                 {
diff --git a/command_table.cpp b/command_table.cpp
index c0e655a..668f19b 100644
--- a/command_table.cpp
+++ b/command_table.cpp
@@ -79,24 +79,24 @@
         bus->async_method_call(
             [handler, this](const boost::system::error_code& ec,
                             const IpmiDbusRspType& response) {
-                if (!ec)
-                {
-                    const uint8_t& cc = std::get<3>(response);
-                    const std::vector<uint8_t>& responseData =
-                        std::get<4>(response);
-                    std::vector<uint8_t> payload;
-                    payload.reserve(1 + responseData.size());
-                    payload.push_back(cc);
-                    payload.insert(payload.end(), responseData.begin(),
-                                   responseData.end());
-                    handler->outPayload = std::move(payload);
-                }
-                else
-                {
-                    std::vector<uint8_t> payload;
-                    payload.push_back(IPMI_CC_UNSPECIFIED_ERROR);
-                    handler->outPayload = std::move(payload);
-                }
+            if (!ec)
+            {
+                const uint8_t& cc = std::get<3>(response);
+                const std::vector<uint8_t>& responseData =
+                    std::get<4>(response);
+                std::vector<uint8_t> payload;
+                payload.reserve(1 + responseData.size());
+                payload.push_back(cc);
+                payload.insert(payload.end(), responseData.begin(),
+                               responseData.end());
+                handler->outPayload = std::move(payload);
+            }
+            else
+            {
+                std::vector<uint8_t> payload;
+                payload.push_back(IPMI_CC_UNSPECIFIED_ERROR);
+                handler->outPayload = std::move(payload);
+            }
             },
             "xyz.openbmc_project.Ipmi.Host", "/xyz/openbmc_project/Ipmi",
             "xyz.openbmc_project.Ipmi.Server", "execute", netFn, lun, cmd,
@@ -119,8 +119,8 @@
             }
         }
 
-        handler->outPayload =
-            iterator->second->executeCommand(commandData, handler);
+        handler->outPayload = iterator->second->executeCommand(commandData,
+                                                               handler);
 
         auto end = std::chrono::steady_clock::now();
 
diff --git a/command_table.hpp b/command_table.hpp
index 295c659..03e1a48 100644
--- a/command_table.hpp
+++ b/command_table.hpp
@@ -14,8 +14,7 @@
 struct CommandID
 {
     static constexpr size_t lunBits = 2;
-    CommandID(uint32_t command) : command(command)
-    {}
+    CommandID(uint32_t command) : command(command) {}
 
     uint8_t netFnLun() const
     {
@@ -216,8 +215,7 @@
     {};
 
   public:
-    explicit Table(const Private&)
-    {}
+    explicit Table(const Private&) {}
     Table() = delete;
     ~Table() = default;
     // Command Table is a singleton so copy, copy-assignment, move and
diff --git a/crypt_algo.hpp b/crypt_algo.hpp
index 1064772..6a8c25d 100644
--- a/crypt_algo.hpp
+++ b/crypt_algo.hpp
@@ -43,8 +43,7 @@
     /**
      * @brief Constructor for Interface
      */
-    explicit Interface(const std::vector<uint8_t>& k2) : k2(k2)
-    {}
+    explicit Interface(const std::vector<uint8_t>& k2) : k2(k2) {}
 
     Interface() = delete;
     virtual ~Interface() = default;
@@ -143,8 +142,7 @@
      *
      * @param[in] - Session Integrity key
      */
-    explicit AlgoAES128(const std::vector<uint8_t>& k2) : Interface(k2)
-    {}
+    explicit AlgoAES128(const std::vector<uint8_t>& k2) : Interface(k2) {}
 
     AlgoAES128() = delete;
     ~AlgoAES128() = default;
diff --git a/integrity_algo.hpp b/integrity_algo.hpp
index d451d0e..6ba6340 100644
--- a/integrity_algo.hpp
+++ b/integrity_algo.hpp
@@ -47,8 +47,7 @@
      *
      * @param[in] - AuthCode length
      */
-    explicit Interface(size_t authLength) : authCodeLength(authLength)
-    {}
+    explicit Interface(size_t authLength) : authCodeLength(authLength) {}
 
     Interface() = delete;
     virtual ~Interface() = default;
diff --git a/message.hpp b/message.hpp
index 7902b1e..1deef71 100644
--- a/message.hpp
+++ b/message.hpp
@@ -247,8 +247,8 @@
     uint32_t sessionSeqNum;     // Session Sequence Number
     ClassOfMsg rmcpMsgClass;    // Class of Message
 #ifdef RMCP_PING
-    uint8_t asfMsgTag; // ASF Message Tag
-#endif                 // RMCP_PING
+    uint8_t asfMsgTag;          // ASF Message Tag
+#endif                          // RMCP_PING
 
     /** @brief Message payload
      *
diff --git a/message_handler.cpp b/message_handler.cpp
index b7314b8..f5c4a1b 100644
--- a/message_handler.cpp
+++ b/message_handler.cpp
@@ -120,8 +120,8 @@
                 return;
             }
 
-            auto start =
-                inMessage->payload.begin() + sizeof(LAN::header::Request);
+            auto start = inMessage->payload.begin() +
+                         sizeof(LAN::header::Request);
             auto end = inMessage->payload.end() - sizeof(LAN::trailer::Request);
             std::vector<uint8_t> inPayload(start, end);
             command::Table::get().executeCommand(command, inPayload,
diff --git a/message_parsers.cpp b/message_parsers.cpp
index c6dd4f8..33b53c1 100644
--- a/message_parsers.cpp
+++ b/message_parsers.cpp
@@ -208,10 +208,10 @@
         throw std::runtime_error("Invalid data length");
     }
 
-    bool integrityMismatch =
-        session->isIntegrityAlgoEnabled() && !message->isPacketAuthenticated;
-    bool encryptMismatch =
-        session->isCryptAlgoEnabled() && !message->isPacketEncrypted;
+    bool integrityMismatch = session->isIntegrityAlgoEnabled() &&
+                             !message->isPacketAuthenticated;
+    bool encryptMismatch = session->isCryptAlgoEnabled() &&
+                           !message->isPacketEncrypted;
 
     if (sessionID != session::sessionZero &&
         (integrityMismatch || encryptMismatch))
@@ -232,8 +232,8 @@
     if (message->isPacketEncrypted)
     {
         // Assign the decrypted payload to the IPMI Message
-        message->payload =
-            internal::decryptPayload(inPacket, message, payloadLen, session);
+        message->payload = internal::decryptPayload(inPacket, message,
+                                                    payloadLen, session);
     }
     else
     {
diff --git a/sd_event_loop.cpp b/sd_event_loop.cpp
index df985c4..fa8319c 100644
--- a/sd_event_loop.cpp
+++ b/sd_event_loop.cpp
@@ -39,13 +39,12 @@
 {
     udpSocket->async_wait(boost::asio::socket_base::wait_read,
                           [this](const boost::system::error_code& ec) {
-                              if (!ec)
-                              {
-                                  boost::asio::post(
-                                      *io, [this]() { startRmcpReceive(); });
-                                  handleRmcpPacket();
-                              }
-                          });
+        if (!ec)
+        {
+            boost::asio::post(*io, [this]() { startRmcpReceive(); });
+            handleRmcpPacket();
+        }
+    });
 }
 
 int EventLoop::getVLANID(const std::string channel)
diff --git a/sessions_manager.cpp b/sessions_manager.cpp
index c18bf80..e878de1 100644
--- a/sessions_manager.cpp
+++ b/sessions_manager.cpp
@@ -62,8 +62,8 @@
     objManager = std::make_unique<sdbusplus::server::manager_t>(
         *getSdBus(), session::sessionManagerRootPath);
 
-    auto objPath =
-        std::string(session::sessionManagerRootPath) + "/" + channel + "/0";
+    auto objPath = std::string(session::sessionManagerRootPath) + "/" +
+                   channel + "/0";
 
     chName = channel;
     setNetworkInstance();
@@ -232,8 +232,8 @@
     // active idle time in seconds = 60 / overflow^3
     constexpr int baseIdleMicros = 60 * 1000 * 1000;
     // no +1 for the zero session here because this is just active sessions
-    int sessionDivisor =
-        getActiveSessionCount() - session::maxSessionCountPerChannel;
+    int sessionDivisor = getActiveSessionCount() -
+                         session::maxSessionCountPerChannel;
     sessionDivisor = std::max(0, sessionDivisor) + 1;
     sessionDivisor = sessionDivisor * sessionDivisor * sessionDivisor;
     int activeMicros = baseIdleMicros / sessionDivisor;
@@ -242,8 +242,8 @@
     // setup idle time in seconds = max(3, 60 / overflow^3)
 
     // +1 for the zero session here because size() counts that too
-    int setupDivisor =
-        sessionsMap.size() - (session::maxSessionCountPerChannel + 1);
+    int setupDivisor = sessionsMap.size() -
+                       (session::maxSessionCountPerChannel + 1);
     setupDivisor = std::max(0, setupDivisor) + 1;
     setupDivisor = setupDivisor * setupDivisor * setupDivisor;
     constexpr int maxSetupMicros = 3 * 1000 * 1000;
diff --git a/socket_channel.hpp b/socket_channel.hpp
index 0edfcd5..02e7040 100644
--- a/socket_channel.hpp
+++ b/socket_channel.hpp
@@ -76,8 +76,8 @@
             const sockaddr_in* sa =
                 reinterpret_cast<const sockaddr_in*>(&remoteSockAddr);
             remoteIpv4Addr = sa->sin_addr.s_addr;
-            retval =
-                inet_ntop(AF_INET, &(sa->sin_addr), ipv4addr, sizeof(ipv4addr));
+            retval = inet_ntop(AF_INET, &(sa->sin_addr), ipv4addr,
+                               sizeof(ipv4addr));
         }
         else if (sockAddrSize == sizeof(sockaddr_in6))
         {
diff --git a/sol/sol_context.cpp b/sol/sol_context.cpp
index 06dabcc..08a717a 100644
--- a/sol/sol_context.cpp
+++ b/sol/sol_context.cpp
@@ -46,12 +46,12 @@
         std::weak_ptr<Context> weakRef = weak_from_this();
         accumulateTimer.async_wait(
             [weakRef](const boost::system::error_code& ec) {
-                std::shared_ptr<Context> self = weakRef.lock();
-                if (!ec && self)
-                {
-                    self->charAccTimerHandler();
-                }
-            });
+            std::shared_ptr<Context> self = weakRef.lock();
+            if (!ec && self)
+            {
+                self->charAccTimerHandler();
+            }
+        });
     }
     else
     {
diff --git a/sol/sol_manager.cpp b/sol/sol_manager.cpp
index 8fabeeb..fd5ad2f 100644
--- a/sol/sol_manager.cpp
+++ b/sol/sol_manager.cpp
@@ -56,8 +56,8 @@
     }
     std::vector<uint8_t> buffer(readSize);
     ec.clear();
-    size_t readDataLen =
-        consoleSocket->read_some(boost::asio::buffer(buffer), ec);
+    size_t readDataLen = consoleSocket->read_some(boost::asio::buffer(buffer),
+                                                  ec);
     if (ec)
     {
         lg2::error("Reading from host console socket failed: {ERROR}", "ERROR",
@@ -101,12 +101,12 @@
 
     consoleSocket->async_wait(boost::asio::socket_base::wait_read,
                               [this](const boost::system::error_code& ec) {
-                                  if (!ec)
-                                  {
-                                      consoleInputHandler();
-                                      startHostConsole();
-                                  }
-                              });
+        if (!ec)
+        {
+            consoleInputHandler();
+            startHostConsole();
+        }
+    });
 } // namespace sol
 
 void Manager::stopHostConsole()
@@ -130,8 +130,8 @@
     {
         try
         {
-            solService =
-                ipmi::getService(dbus, solInterface, solPathWitheEthName);
+            solService = ipmi::getService(dbus, solInterface,
+                                          solPathWitheEthName);
         }
         catch (const std::runtime_error& e)
         {
@@ -251,21 +251,21 @@
                     type::signal() + member("PropertiesChanged") +
                     interface("org.freedesktop.DBus.Properties"),
                 [](sdbusplus::message_t& msg) {
-                    std::string intfName;
-                    std::map<std::string, std::variant<bool>> properties;
-                    msg.read(intfName, properties);
+                std::string intfName;
+                std::map<std::string, std::variant<bool>> properties;
+                msg.read(intfName, properties);
 
-                    const auto it = properties.find("Enabled");
-                    if (it != properties.end())
+                const auto it = properties.find("Enabled");
+                if (it != properties.end())
+                {
+                    const bool* state = std::get_if<bool>(&it->second);
+
+                    if (state != nullptr && *state == false)
                     {
-                        const bool* state = std::get_if<bool>(&it->second);
-
-                        if (state != nullptr && *state == false)
-                        {
-                            // Stop all the payload session.
-                            sol::Manager::get().stopAllPayloadInstance();
-                        }
+                        // Stop all the payload session.
+                        sol::Manager::get().stopAllPayloadInstance();
                     }
+                }
                 });
         }
     }
@@ -335,8 +335,8 @@
         }
         else if (prop.first == "RetryIntervalMS")
         {
-            sol::Manager::get().retryInterval =
-                std::get<uint8_t>(prop.second) * sol::retryIntervalFactor * 1ms;
+            sol::Manager::get().retryInterval = std::get<uint8_t>(prop.second) *
+                                                sol::retryIntervalFactor * 1ms;
         }
     }
 }
