diff --git a/.clang-format b/.clang-format
index 3a6c983..4922cf6 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,8 +52,8 @@
 ConstructorInitializerIndentWidth: 4
 ContinuationIndentWidth: 4
 Cpp11BracedListStyle: true
+DeriveLineEnding: false
 DerivePointerAlignment: false
-LambdaBodyIndentation: OuterScope
 PointerAlignment: Left
 DisableFormat:   false
 ExperimentalAutoDetectBinPacking: false
@@ -75,9 +78,14 @@
   - Regex:           '.*'
     Priority:        6
 IndentCaseLabels: true
+IndentExternBlock: NoIndent
+IndentRequiresClause: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
-KeepEmptyLinesAtTheStartOfBlocks: true
+InsertNewlineAtEOF: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
 MaxEmptyLinesToKeep: 1
@@ -85,13 +93,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
@@ -109,7 +123,7 @@
 SpacesInCStyleCastParentheses: false
 SpacesInParentheses: false
 SpacesInSquareBrackets: false
-Standard:        Cpp11
+Standard:        Latest
 TabWidth:        4
 UseTab:          Never
 ...
diff --git a/src/ADCSensorMain.cpp b/src/ADCSensorMain.cpp
index 4987f1f..af4e0c2 100644
--- a/src/ADCSensorMain.cpp
+++ b/src/ADCSensorMain.cpp
@@ -201,8 +201,8 @@
             auto findCPU = baseConfiguration->second.find("CPURequired");
             if (findCPU != baseConfiguration->second.end())
             {
-                size_t index =
-                    std::visit(VariantToIntVisitor(), findCPU->second);
+                size_t index = std::visit(VariantToIntVisitor(),
+                                          findCPU->second);
                 auto presenceFind = cpuPresence.find(index);
                 if (presenceFind == cpuPresence.end())
                 {
@@ -239,8 +239,8 @@
                 }
             }
 
-            float pollRate =
-                getPollRate(baseConfiguration->second, pollRateDefault);
+            float pollRate = getPollRate(baseConfiguration->second,
+                                         pollRateDefault);
             PowerState readState = getPowerState(baseConfiguration->second);
 
             auto& sensor = sensors[sensorName];
diff --git a/src/ExitAirTempSensor.cpp b/src/ExitAirTempSensor.cpp
index 9beae58..0797bf0 100644
--- a/src/ExitAirTempSensor.cpp
+++ b/src/ExitAirTempSensor.cpp
@@ -67,7 +67,6 @@
     const std::string& type,
     std::function<void(const double&, sdbusplus::message_t&)>&& callback)
 {
-
     std::function<void(sdbusplus::message_t & message)> eventHandler =
         [callback{std::move(callback)}](sdbusplus::message_t& message) {
         std::string objectName;
@@ -192,7 +191,6 @@
 
 void CFMSensor::setupMatches()
 {
-
     std::weak_ptr<CFMSensor> weakRef = weak_from_this();
     setupSensorMatch(
         matches, *dbusConnection, "fan_tach",
@@ -226,7 +224,6 @@
         uint64_t maxRpm = 100;
         if (!ec)
         {
-
             const auto* cfm = std::get_if<double>(&cfmVariant);
             if (cfm != nullptr && *cfm >= minSystemCfm)
             {
@@ -404,7 +401,6 @@
     double totalCFM = 0;
     for (const std::string& tachName : tachs)
     {
-
         auto findReading = std::find_if(
             tachReadings.begin(), tachReadings.end(),
             [&](const auto& item) { return item.first.ends_with(tachName); });
@@ -619,8 +615,8 @@
                     {
                         return;
                     }
-                    double reading =
-                        std::visit(VariantToDoubleVisitor(), value);
+                    double reading = std::visit(VariantToDoubleVisitor(),
+                                                value);
                     if constexpr (debug)
                     {
                         std::cerr << cbPath << "Reading " << reading << "\n";
@@ -639,7 +635,6 @@
 
 void ExitAirTempSensor::updateReading(void)
 {
-
     double val = 0.0;
     if (calculate(val))
     {
@@ -930,7 +925,6 @@
 
 int main()
 {
-
     boost::asio::io_context io;
     auto systemBus = std::make_shared<sdbusplus::asio::connection>(io);
     sdbusplus::asio::object_server objectServer(systemBus, true);
diff --git a/src/ExitAirTempSensor.hpp b/src/ExitAirTempSensor.hpp
index 5bd9735..bea8fba 100644
--- a/src/ExitAirTempSensor.hpp
+++ b/src/ExitAirTempSensor.hpp
@@ -50,7 +50,6 @@
     public Sensor,
     std::enable_shared_from_this<ExitAirTempSensor>
 {
-
     double powerFactorMin = 0.0;
     double powerFactorMax = 0.0;
     double qMin = 0.0;
diff --git a/src/ExternalSensor.cpp b/src/ExternalSensor.cpp
index cbba6e1..1717e49 100644
--- a/src/ExternalSensor.cpp
+++ b/src/ExternalSensor.cpp
@@ -55,8 +55,8 @@
             objectServer.add_interface(objectPath, interface);
     }
 
-    association =
-        objectServer.add_interface(objectPath, association::interface);
+    association = objectServer.add_interface(objectPath,
+                                             association::interface);
     setInitialProperties(sensorUnits);
 
     if constexpr (debug)
diff --git a/src/ExternalSensorMain.cpp b/src/ExternalSensorMain.cpp
index 2c10dc8..455df07 100644
--- a/src/ExternalSensorMain.cpp
+++ b/src/ExternalSensorMain.cpp
@@ -190,8 +190,8 @@
                           << interfacePath << "\n";
                 continue;
             }
-            double minValue =
-                std::visit(VariantToDoubleVisitor(), minFound->second);
+            double minValue = std::visit(VariantToDoubleVisitor(),
+                                         minFound->second);
             if (!std::isfinite(minValue))
             {
                 std::cerr << "MinValue parameter not parsed for "
@@ -206,8 +206,8 @@
                           << interfacePath << "\n";
                 continue;
             }
-            double maxValue =
-                std::visit(VariantToDoubleVisitor(), maxFound->second);
+            double maxValue = std::visit(VariantToDoubleVisitor(),
+                                         maxFound->second);
             if (!std::isfinite(maxValue))
             {
                 std::cerr << "MaxValue parameter not parsed for "
@@ -221,8 +221,8 @@
             auto timeoutFound = baseConfigMap.find("Timeout");
             if (timeoutFound != baseConfigMap.end())
             {
-                timeoutSecs =
-                    std::visit(VariantToDoubleVisitor(), timeoutFound->second);
+                timeoutSecs = std::visit(VariantToDoubleVisitor(),
+                                         timeoutFound->second);
             }
             if (!std::isfinite(timeoutSecs) || (timeoutSecs < 0.0))
             {
@@ -242,8 +242,8 @@
                           << "\n";
                 continue;
             }
-            sensorName =
-                std::visit(VariantToStringVisitor(), nameFound->second);
+            sensorName = std::visit(VariantToStringVisitor(),
+                                    nameFound->second);
             if (sensorName.empty())
             {
                 std::cerr << "Name parameter not parsed for " << interfacePath
@@ -258,8 +258,8 @@
                           << "\n";
                 continue;
             }
-            sensorUnits =
-                std::visit(VariantToStringVisitor(), unitsFound->second);
+            sensorUnits = std::visit(VariantToStringVisitor(),
+                                     unitsFound->second);
             if (sensorUnits.empty())
             {
                 std::cerr << "Units parameter not parsed for " << interfacePath
diff --git a/src/FanMain.cpp b/src/FanMain.cpp
index 85de747..9c8a738 100644
--- a/src/FanMain.cpp
+++ b/src/FanMain.cpp
@@ -209,7 +209,6 @@
     const std::shared_ptr<sdbusplus::asio::connection>& conn,
     sdbusplus::asio::object_server& objectServer)
 {
-
     conn->async_method_call(
         [&objectServer, &sensors](boost::system::error_code& ec,
                                   const ManagedObjectType& managedObj) {
@@ -485,8 +484,8 @@
                         continue;
                     }
 
-                    fs::path pwmEnableFile =
-                        "pwm" + std::to_string(pwm + 1) + "_enable";
+                    fs::path pwmEnableFile = "pwm" + std::to_string(pwm + 1) +
+                                             "_enable";
                     fs::path enablePath = pwmPath.parent_path() / pwmEnableFile;
                     enablePwm(enablePath);
 
diff --git a/src/FileHandle.cpp b/src/FileHandle.cpp
index 227ce23..d36911c 100644
--- a/src/FileHandle.cpp
+++ b/src/FileHandle.cpp
@@ -21,7 +21,6 @@
 
 FileHandle::FileHandle(FileHandle&& in) noexcept : fd(in.fd)
 {
-
     in.fd = -1;
 }
 
diff --git a/src/FileHandle.hpp b/src/FileHandle.hpp
index a2a75d8..bcb774a 100644
--- a/src/FileHandle.hpp
+++ b/src/FileHandle.hpp
@@ -24,4 +24,4 @@
 
     ~FileHandle();
     int handle() const;
-};
\ No newline at end of file
+};
diff --git a/src/HwmonTempMain.cpp b/src/HwmonTempMain.cpp
index 4c28345..40451e1 100644
--- a/src/HwmonTempMain.cpp
+++ b/src/HwmonTempMain.cpp
@@ -82,13 +82,13 @@
 {
     // offset is to default to 0 and scale to 1, see lore
     // https://lore.kernel.org/linux-iio/5c79425f-6e88-36b6-cdfe-4080738d039f@metafoo.de/
-    struct SensorParams tmpSensorParameters = {.minValue = minValueTemperature,
-                                               .maxValue = maxValueTemperature,
-                                               .offsetValue = 0.0,
-                                               .scaleValue = 1.0,
-                                               .units =
-                                                   sensor_paths::unitDegreesC,
-                                               .typeName = "temperature"};
+    struct SensorParams tmpSensorParameters = {
+        .minValue = minValueTemperature,
+        .maxValue = maxValueTemperature,
+        .offsetValue = 0.0,
+        .scaleValue = 1.0,
+        .units = sensor_paths::unitDegreesC,
+        .typeName = "temperature"};
 
     // For IIO RAW sensors we get a raw_value, an offset, and scale
     // to compute the value = (raw_value + offset) * scale
@@ -99,8 +99,8 @@
     const std::string pathStr = path.string();
     if (pathStr.ends_with("_raw"))
     {
-        std::string pathOffsetStr =
-            pathStr.substr(0, pathStr.size() - 4) + "_offset";
+        std::string pathOffsetStr = pathStr.substr(0, pathStr.size() - 4) +
+                                    "_offset";
         std::optional<double> tmpOffsetValue = readFile(pathOffsetStr, 1.0);
         // In case there is nothing to read skip this device
         // This is not an error condition see lore
@@ -110,8 +110,8 @@
             tmpSensorParameters.offsetValue = *tmpOffsetValue;
         }
 
-        std::string pathScaleStr =
-            pathStr.substr(0, pathStr.size() - 4) + "_scale";
+        std::string pathScaleStr = pathStr.substr(0, pathStr.size() - 4) +
+                                   "_scale";
         std::optional<double> tmpScaleValue = readFile(pathScaleStr, 1.0);
         // In case there is nothing to read skip this device
         // This is not an error condition see lore
@@ -487,8 +487,8 @@
             {
                 sensor = nullptr;
             }
-            auto hwmonFile =
-                getFullHwmonFilePath(directory.string(), "temp1", permitSet);
+            auto hwmonFile = getFullHwmonFilePath(directory.string(), "temp1",
+                                                  permitSet);
             if (pathStr.starts_with("/sys/bus/iio/devices"))
             {
                 hwmonFile = pathStr;
diff --git a/src/HwmonTempSensor.cpp b/src/HwmonTempSensor.cpp
index 180c0c8..bd442f8 100644
--- a/src/HwmonTempSensor.cpp
+++ b/src/HwmonTempSensor.cpp
@@ -172,8 +172,8 @@
     {
         const char* bufEnd = readBuf.data() + bytesRead;
         int nvalue = 0;
-        std::from_chars_result ret =
-            std::from_chars(readBuf.data(), bufEnd, nvalue);
+        std::from_chars_result ret = std::from_chars(readBuf.data(), bufEnd,
+                                                     nvalue);
         if (ret.ec != std::errc())
         {
             incrementError();
diff --git a/src/IntelCPUSensor.cpp b/src/IntelCPUSensor.cpp
index fa26332..2bebcd8 100644
--- a/src/IntelCPUSensor.cpp
+++ b/src/IntelCPUSensor.cpp
@@ -66,8 +66,8 @@
             }
             else
             {
-                interfacePath =
-                    "/xyz/openbmc_project/sensors/temperature/" + name;
+                interfacePath = "/xyz/openbmc_project/sensors/temperature/" +
+                                name;
                 units = sensor_paths::unitDegreesC;
                 minValue = -128;
                 maxValue = 127;
@@ -192,8 +192,8 @@
             {
                 const auto& [suffix, oldValue, dbusName] = vectorItem;
                 auto attrPath = boost::replace_all_copy(path, fileItem, suffix);
-                if (auto newVal =
-                        readFile(attrPath, IntelCPUSensor::sensorScaleFactor))
+                if (auto newVal = readFile(attrPath,
+                                           IntelCPUSensor::sensorScaleFactor))
                 {
                     updateProperty(sensorInterface, oldValue, *newVal,
                                    dbusName);
@@ -258,7 +258,6 @@
 
     if (rdLen > 0)
     {
-
         try
         {
             rawValue = std::stod(response);
diff --git a/src/IntelCPUSensor.hpp b/src/IntelCPUSensor.hpp
index b23c0dc..0417c6e 100644
--- a/src/IntelCPUSensor.hpp
+++ b/src/IntelCPUSensor.hpp
@@ -70,8 +70,8 @@
     {
         return false;
     }
-    std::string gpioName =
-        std::visit(VariantToStringVisitor(), findName->second);
+    std::string gpioName = std::visit(VariantToStringVisitor(),
+                                      findName->second);
 
     auto findIndex = cpuPresence.find(gpioName);
     if (findIndex != cpuPresence.end())
diff --git a/src/IntelCPUSensorMain.cpp b/src/IntelCPUSensorMain.cpp
index 011f2fb..9e48184 100644
--- a/src/IntelCPUSensorMain.cpp
+++ b/src/IntelCPUSensorMain.cpp
@@ -291,8 +291,8 @@
             std::cerr << "could not determine CPU ID for " << hwmonName << "\n";
             continue;
         }
-        int cpuId =
-            std::visit(VariantToUnsignedIntVisitor(), findCpuId->second);
+        int cpuId = std::visit(VariantToUnsignedIntVisitor(),
+                               findCpuId->second);
 
         auto directory = hwmonNamePath.parent_path();
         std::vector<fs::path> inputPaths;
@@ -313,8 +313,8 @@
             }
             auto& [type, nr, item] = *fileParts;
             auto inputPathStr = inputPath.string();
-            auto labelPath =
-                boost::replace_all_copy(inputPathStr, item, "label");
+            auto labelPath = boost::replace_all_copy(inputPathStr, item,
+                                                     "label");
             std::ifstream labelFile(labelPath);
             if (!labelFile.good())
             {
@@ -672,10 +672,10 @@
                 {
                     continue;
                 }
-                std::string nameRaw =
-                    std::visit(VariantToStringVisitor(), findName->second);
-                std::string name =
-                    std::regex_replace(nameRaw, illegalDbusRegex, "_");
+                std::string nameRaw = std::visit(VariantToStringVisitor(),
+                                                 findName->second);
+                std::string name = std::regex_replace(nameRaw, illegalDbusRegex,
+                                                      "_");
 
                 auto present = std::optional<bool>();
                 // if we can't detect it via gpio, we set presence later
@@ -706,8 +706,8 @@
                     std::cerr << "Can't find 'Bus' setting in " << name << "\n";
                     continue;
                 }
-                uint64_t bus =
-                    std::visit(VariantToUnsignedIntVisitor(), findBus->second);
+                uint64_t bus = std::visit(VariantToUnsignedIntVisitor(),
+                                          findBus->second);
 
                 auto findAddress = cfg.find("Address");
                 if (findAddress == cfg.end())
diff --git a/src/IntrusionSensorMain.cpp b/src/IntrusionSensorMain.cpp
index 362ffce..c2783b7 100644
--- a/src/IntrusionSensorMain.cpp
+++ b/src/IntrusionSensorMain.cpp
@@ -181,48 +181,48 @@
     const std::shared_ptr<sdbusplus::asio::connection>& dbusConnection)
 {
     auto getter = std::make_shared<GetSensorConfiguration>(
-        dbusConnection, [](const ManagedObjectType& sensorConfigurations) {
-            // Get NIC name and save to map
-            lanInfoMap.clear();
-            for (const auto& [path, cfgData] : sensorConfigurations)
+        dbusConnection,
+        [](const ManagedObjectType& sensorConfigurations) {
+        // Get NIC name and save to map
+        lanInfoMap.clear();
+        for (const auto& [path, cfgData] : sensorConfigurations)
+        {
+            const std::pair<std::string, SensorBaseConfigMap>*
+                baseConfiguration = nullptr;
+
+            // find base configuration
+            auto sensorBase = cfgData.find(configInterfaceName(nicType));
+            if (sensorBase == cfgData.end())
             {
-                const std::pair<std::string, SensorBaseConfigMap>*
-                    baseConfiguration = nullptr;
+                continue;
+            }
+            baseConfiguration = &(*sensorBase);
 
-                // find base configuration
-                auto sensorBase = cfgData.find(configInterfaceName(nicType));
-                if (sensorBase == cfgData.end())
+            auto findEthIndex = baseConfiguration->second.find("EthIndex");
+            auto findName = baseConfiguration->second.find("Name");
+
+            if (findEthIndex != baseConfiguration->second.end() &&
+                findName != baseConfiguration->second.end())
+            {
+                const auto* pEthIndex =
+                    std::get_if<uint64_t>(&findEthIndex->second);
+                const auto* pName = std::get_if<std::string>(&findName->second);
+                if (pEthIndex != nullptr && pName != nullptr)
                 {
-                    continue;
-                }
-                baseConfiguration = &(*sensorBase);
-
-                auto findEthIndex = baseConfiguration->second.find("EthIndex");
-                auto findName = baseConfiguration->second.find("Name");
-
-                if (findEthIndex != baseConfiguration->second.end() &&
-                    findName != baseConfiguration->second.end())
-                {
-                    const auto* pEthIndex =
-                        std::get_if<uint64_t>(&findEthIndex->second);
-                    const auto* pName =
-                        std::get_if<std::string>(&findName->second);
-                    if (pEthIndex != nullptr && pName != nullptr)
+                    lanInfoMap[*pEthIndex] = *pName;
+                    if (debugLanLeash)
                     {
-                        lanInfoMap[*pEthIndex] = *pName;
-                        if (debugLanLeash)
-                        {
-                            std::cout << "find name of eth" << *pEthIndex
-                                      << " is " << *pName << "\n";
-                        }
+                        std::cout << "find name of eth" << *pEthIndex << " is "
+                                  << *pName << "\n";
                     }
                 }
             }
+        }
 
-            if (lanInfoMap.empty())
-            {
-                std::cerr << "can't find matched NIC name. \n";
-            }
+        if (lanInfoMap.empty())
+        {
+            std::cerr << "can't find matched NIC name. \n";
+        }
         });
 
     getter->getConfiguration(
@@ -306,8 +306,8 @@
     {
         std::string strEthNum = "eth" + std::to_string(ethNum) + lanInfo;
         const auto* strState = newLanConnected ? "connected" : "lost";
-        const auto* strMsgId =
-            newLanConnected ? "OpenBMC.0.1.LanRegained" : "OpenBMC.0.1.LanLost";
+        const auto* strMsgId = newLanConnected ? "OpenBMC.0.1.LanRegained"
+                                               : "OpenBMC.0.1.LanLost";
 
         lg2::info("{ETHDEV} LAN leash {STATE}", "ETHDEV", strEthNum, "STATE",
                   strState, "REDFISH_MESSAGE_ID", strMsgId,
@@ -393,9 +393,9 @@
                 std::cerr << "Unable to read lan status value\n";
                 return;
             }
-            bool isLanConnected =
-                (*pState == "routable" || *pState == "carrier" ||
-                 *pState == "degraded");
+            bool isLanConnected = (*pState == "routable" ||
+                                   *pState == "carrier" ||
+                                   *pState == "degraded");
             if (debugLanLeash)
             {
                 std::cout << "ethNum = " << std::to_string(ethNum)
diff --git a/src/IpmbSDRSensor.cpp b/src/IpmbSDRSensor.cpp
index 73cfb43..d0ab884 100644
--- a/src/IpmbSDRSensor.cpp
+++ b/src/IpmbSDRSensor.cpp
@@ -65,8 +65,8 @@
         constexpr uint8_t recordCountLSB = 1;
         constexpr uint8_t recordCountMSB = 2;
 
-        uint16_t recordCount =
-            (data[recordCountMSB] << 8) | data[recordCountLSB];
+        uint16_t recordCount = (data[recordCountMSB] << 8) |
+                               data[recordCountLSB];
 
         self->reserveSDRRepository(recordCount);
         },
@@ -225,8 +225,8 @@
     int strLen = (sdrDataBytes[sdrtype01::nameLengthByte]) & (sdrLenBit);
 
     /* iStrAddr represents the starting byte (Byte 56) for SDR sensor name */
-    int strAddr =
-        dataLen + ((dataLen / (sdr::perCountByte)) * 4) - (strLen - 1);
+    int strAddr = dataLen + ((dataLen / (sdr::perCountByte)) * 4) -
+                  (strLen - 1);
 
     /* Below for loop will convert the bytes to string and form a sensor name */
 
@@ -252,24 +252,24 @@
 
     /* sdrSensCapability (Byte 13) and(&) with sdrThresAccess(0x0C) will declare
      * whether threshold is present for each sensor */
-    int threshold =
-        (sdrDataBytes[sdrtype01::sensorCapability]) & (sdrThresAccess);
+    int threshold = (sdrDataBytes[sdrtype01::sensorCapability]) &
+                    (sdrThresAccess);
 
     /* mData        - 10 bits
      * mDataByte    - Byte 28 - 8 bits LSB
      * mTolDataByte - Byte 29 - 2 bits MSB [7-6]
      */
-    uint16_t mData =
-        ((sdrDataBytes[sdrtype01::mTolDataByte] & 0xC0) << bitShiftMsb) |
-        sdrDataBytes[sdrtype01::mDataByte];
+    uint16_t mData = ((sdrDataBytes[sdrtype01::mTolDataByte] & 0xC0)
+                      << bitShiftMsb) |
+                     sdrDataBytes[sdrtype01::mDataByte];
 
     /* bData        - 10 bits
      * bDataByte    - Byte 30 - 8 bits LSB
      * bAcuDataByte - Byte 31 - 2 bits MSB [7-6]
      */
-    uint16_t bData =
-        ((sdrDataBytes[sdrtype01::bAcuDataByte] & 0xC0) << bitShiftMsb) |
-        sdrDataBytes[sdrtype01::bDataByte];
+    uint16_t bData = ((sdrDataBytes[sdrtype01::bAcuDataByte] & 0xC0)
+                      << bitShiftMsb) |
+                     sdrDataBytes[sdrtype01::bDataByte];
 
     /* rbExpDataByte (Byte 33) represents the exponent value
      *  Bit [3-0] - B Exponent 2's complement signed bit.
diff --git a/src/IpmbSensor.cpp b/src/IpmbSensor.cpp
index 17ccbbb..51ccde1 100644
--- a/src/IpmbSensor.cpp
+++ b/src/IpmbSensor.cpp
@@ -267,7 +267,6 @@
 
 bool IpmbSensor::processReading(const std::vector<uint8_t>& data, double& resp)
 {
-
     switch (readingFormat)
     {
         case (ReadingFormat::byte0):
@@ -550,8 +549,8 @@
                 }
                 uint8_t deviceAddress = loadVariant<uint8_t>(cfg, "Address");
 
-                std::string sensorClass =
-                    loadVariant<std::string>(cfg, "Class");
+                std::string sensorClass = loadVariant<std::string>(cfg,
+                                                                   "Class");
 
                 uint8_t hostSMbusIndex = hostSMbusIndexDefault;
                 auto findSmType = cfg.find("HostSMbusIndex");
@@ -578,8 +577,8 @@
                 auto findType = cfg.find("SensorType");
                 if (findType != cfg.end())
                 {
-                    sensorTypeName =
-                        std::visit(VariantToStringVisitor(), findType->second);
+                    sensorTypeName = std::visit(VariantToStringVisitor(),
+                                                findType->second);
                 }
 
                 auto& sensor = sensors[name];
@@ -702,7 +701,6 @@
 
 int main()
 {
-
     boost::asio::io_context io;
     auto systemBus = std::make_shared<sdbusplus::asio::connection>(io);
     sdbusplus::asio::object_server objectServer(systemBus, true);
diff --git a/src/MCUTempSensor.cpp b/src/MCUTempSensor.cpp
index dc7782c..e82c80f 100644
--- a/src/MCUTempSensor.cpp
+++ b/src/MCUTempSensor.cpp
@@ -228,8 +228,8 @@
                 uint8_t mcuAddress = loadVariant<uint8_t>(cfg, "Address");
                 uint8_t tempReg = loadVariant<uint8_t>(cfg, "Reg");
 
-                std::string sensorClass =
-                    loadVariant<std::string>(cfg, "Class");
+                std::string sensorClass = loadVariant<std::string>(cfg,
+                                                                   "Class");
 
                 if constexpr (debug)
                 {
diff --git a/src/NVMeSensorMain.cpp b/src/NVMeSensorMain.cpp
index 9cd453e..9483a3d 100644
--- a/src/NVMeSensorMain.cpp
+++ b/src/NVMeSensorMain.cpp
@@ -151,10 +151,10 @@
         }
 
         const SensorBaseConfigMap& sensorConfig = sensorBase->second;
-        std::optional<int> busNumber =
-            extractBusNumber(interfacePath, sensorConfig);
-        std::optional<std::string> sensorName =
-            extractSensorName(interfacePath, sensorConfig);
+        std::optional<int> busNumber = extractBusNumber(interfacePath,
+                                                        sensorConfig);
+        std::optional<std::string> sensorName = extractSensorName(interfacePath,
+                                                                  sensorConfig);
         uint8_t slaveAddr = extractSlaveAddr(interfacePath, sensorConfig);
         std::optional<int> rootBus = deriveRootBus(busNumber);
 
@@ -203,7 +203,6 @@
                    sdbusplus::asio::object_server& objectServer,
                    std::shared_ptr<sdbusplus::asio::connection>& dbusConnection)
 {
-
     auto getter = std::make_shared<GetSensorConfiguration>(
         dbusConnection, [&io, &objectServer, &dbusConnection](
                             const ManagedObjectType& sensorConfigurations) {
diff --git a/src/PSUSensorMain.cpp b/src/PSUSensorMain.cpp
index a827a44..053de6f 100644
--- a/src/PSUSensorMain.cpp
+++ b/src/PSUSensorMain.cpp
@@ -459,11 +459,11 @@
         if (!firstScan)
         {
             std::string psuNameStr = "/" + escapeName(*psuName);
-            auto it =
-                std::find_if(sensorsChanged->begin(), sensorsChanged->end(),
-                             [psuNameStr](std::string& s) {
+            auto it = std::find_if(sensorsChanged->begin(),
+                                   sensorsChanged->end(),
+                                   [psuNameStr](std::string& s) {
                 return s.ends_with(psuNameStr);
-                });
+            });
 
             if (it == sensorsChanged->end())
             {
@@ -544,12 +544,11 @@
             size_t pos = sensorPathStr.find('_');
             if (pos != std::string::npos)
             {
-
                 std::string sensorPathStrMax = sensorPathStr.substr(pos);
                 if (sensorPathStrMax == "_max")
                 {
-                    labelPath =
-                        boost::replace_all_copy(sensorPathStr, "max", "label");
+                    labelPath = boost::replace_all_copy(sensorPathStr, "max",
+                                                        "label");
                     maxLabel = true;
                 }
                 else
@@ -872,8 +871,8 @@
             {
                 // Sensor name not customized, do prefix/suffix composition,
                 // preserving default behavior by using psuNameFromIndex.
-                sensorName =
-                    psuNameFromIndex + " " + psuProperty->labelTypeName;
+                sensorName = psuNameFromIndex + " " +
+                             psuProperty->labelTypeName;
             }
 
             if constexpr (debug)
diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp
index 3971324..41d625b 100644
--- a/src/TachSensor.cpp
+++ b/src/TachSensor.cpp
@@ -169,8 +169,8 @@
         {
             const char* bufEnd = readBuf.data() + bytesRead;
             int nvalue = 0;
-            std::from_chars_result ret =
-                std::from_chars(readBuf.data(), bufEnd, nvalue);
+            std::from_chars_result ret = std::from_chars(readBuf.data(), bufEnd,
+                                                         nvalue);
             if (ret.ec != std::errc())
             {
                 incrementError();
diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
index b751c67..d2811f3 100644
--- a/src/Thresholds.cpp
+++ b/src/Thresholds.cpp
@@ -93,8 +93,8 @@
         auto hysteresisFind = cfg.find("Hysteresis");
         if (hysteresisFind != cfg.end())
         {
-            hysteresis =
-                std::visit(VariantToDoubleVisitor(), hysteresisFind->second);
+            hysteresis = std::visit(VariantToDoubleVisitor(),
+                                    hysteresisFind->second);
         }
 
         auto directionFind = cfg.find("Direction");
@@ -107,11 +107,11 @@
                       << intf << "\n";
             return false;
         }
-        unsigned int severity =
-            std::visit(VariantToUnsignedIntVisitor(), severityFind->second);
+        unsigned int severity = std::visit(VariantToUnsignedIntVisitor(),
+                                           severityFind->second);
 
-        std::string directions =
-            std::visit(VariantToStringVisitor(), directionFind->second);
+        std::string directions = std::visit(VariantToStringVisitor(),
+                                            directionFind->second);
 
         Level level = findThresholdLevel(severity);
         Direction direction = findThresholdDirection(directions);
@@ -134,8 +134,8 @@
 {
     for (size_t ii = 0; ii < thresholdCount; ii++)
     {
-        std::string thresholdInterface =
-            baseInterface + ".Thresholds" + std::to_string(ii);
+        std::string thresholdInterface = baseInterface + ".Thresholds" +
+                                         std::to_string(ii);
         conn->async_method_call(
             [&, path, threshold, thresholdInterface,
              labelMatch](const boost::system::error_code& ec,
@@ -153,8 +153,8 @@
                     std::cerr << "No label in threshold configuration\n";
                     return;
                 }
-                std::string label =
-                    std::visit(VariantToStringVisitor(), labelFind->second);
+                std::string label = std::visit(VariantToStringVisitor(),
+                                               labelFind->second);
                 if (label != labelMatch)
                 {
                     return;
@@ -170,11 +170,11 @@
                 std::cerr << "Malformed threshold in configuration\n";
                 return;
             }
-            unsigned int severity =
-                std::visit(VariantToUnsignedIntVisitor(), severityFind->second);
+            unsigned int severity = std::visit(VariantToUnsignedIntVisitor(),
+                                               severityFind->second);
 
-            std::string dir =
-                std::visit(VariantToStringVisitor(), directionFind->second);
+            std::string dir = std::visit(VariantToStringVisitor(),
+                                         directionFind->second);
             if ((findThresholdLevel(severity) != threshold.level) ||
                 (findThresholdDirection(dir) != threshold.direction))
             {
@@ -209,8 +209,8 @@
             continue;
         }
 
-        std::string property =
-            Sensor::propertyLevel(threshold.level, threshold.direction);
+        std::string property = Sensor::propertyLevel(threshold.level,
+                                                     threshold.direction);
         if (property.empty())
         {
             continue;
@@ -506,8 +506,8 @@
             for (const auto& t : map.at(item))
             {
                 const auto& [suffix, level, direction, offset] = t;
-                auto attrPath =
-                    boost::replace_all_copy(inputPath, item, suffix);
+                auto attrPath = boost::replace_all_copy(inputPath, item,
+                                                        suffix);
                 if (auto val = readFile(attrPath, scaleFactor))
                 {
                     *val += offset;
diff --git a/src/Thresholds.hpp b/src/Thresholds.hpp
index a89c1dc..fa7ce0c 100644
--- a/src/Thresholds.hpp
+++ b/src/Thresholds.hpp
@@ -68,7 +68,6 @@
 
 struct ThresholdTimer
 {
-
     explicit ThresholdTimer(boost::asio::io_context& ioService) : io(ioService)
     {}
 
diff --git a/src/Utils.hpp b/src/Utils.hpp
index 444030c..0373563 100644
--- a/src/Utils.hpp
+++ b/src/Utils.hpp
@@ -180,7 +180,6 @@
 
 inline void setReadState(const std::string& str, PowerState& val)
 {
-
     if (str == "On")
     {
         val = PowerState::on;
@@ -205,8 +204,8 @@
     auto findPowerState = cfg.find("PowerState");
     if (findPowerState != cfg.end())
     {
-        std::string powerState =
-            std::visit(VariantToStringVisitor(), findPowerState->second);
+        std::string powerState = std::visit(VariantToStringVisitor(),
+                                            findPowerState->second);
         setReadState(powerState, state);
     }
     return state;
diff --git a/src/sensor.hpp b/src/sensor.hpp
index 434d81d..27bbd1a 100644
--- a/src/sensor.hpp
+++ b/src/sensor.hpp
@@ -288,17 +288,17 @@
                 continue;
             }
 
-            std::string level =
-                propertyLevel(threshold.level, threshold.direction);
-            std::string alarm =
-                propertyAlarm(threshold.level, threshold.direction);
+            std::string level = propertyLevel(threshold.level,
+                                              threshold.direction);
+            std::string alarm = propertyAlarm(threshold.level,
+                                              threshold.direction);
 
             if ((level.empty()) || (alarm.empty()))
             {
                 continue;
             }
-            size_t thresSize =
-                label.empty() ? thresholds.size() : thresholdSize;
+            size_t thresSize = label.empty() ? thresholds.size()
+                                             : thresholdSize;
             iface->register_property(
                 level, threshold.value,
                 [&, label, thresSize](const double& request, double& oldValue) {
diff --git a/tests/test_Utils.cpp b/tests/test_Utils.cpp
index 2be1027..8a52699 100644
--- a/tests/test_Utils.cpp
+++ b/tests/test_Utils.cpp
@@ -49,8 +49,8 @@
     void createPECIDir()
     {
         peciDir = fs::path(testDir) / "peci";
-        auto peci0 =
-            peciDir / "peci-0/device/0-30/peci-cputemp.0/hwmon/hwmon25";
+        auto peci0 = peciDir /
+                     "peci-0/device/0-30/peci-cputemp.0/hwmon/hwmon25";
         fs::create_directories(peci0);
         {
             std::ofstream temp0Input{peci0 / "temp0_input"};
@@ -108,9 +108,9 @@
 TEST_F(TestUtils, findFiles_in_peci_no_match)
 {
     std::vector<fs::path> foundPaths;
-    auto ret =
-        findFiles(peciDir, R"(peci-\d+/\d+-.+/peci-.+/hwmon/hwmon\d+/aaa$)",
-                  foundPaths, 6);
+    auto ret = findFiles(peciDir,
+                         R"(peci-\d+/\d+-.+/peci-.+/hwmon/hwmon\d+/aaa$)",
+                         foundPaths, 6);
 
     EXPECT_TRUE(ret);
     EXPECT_TRUE(foundPaths.empty());
@@ -119,9 +119,9 @@
 TEST_F(TestUtils, findFiles_in_peci_match)
 {
     std::vector<fs::path> foundPaths;
-    auto ret =
-        findFiles(peciDir, R"(peci-\d+/\d+-.+/peci-.+/hwmon/hwmon\d+/name$)",
-                  foundPaths, 6);
+    auto ret = findFiles(peciDir,
+                         R"(peci-\d+/\d+-.+/peci-.+/hwmon/hwmon\d+/name$)",
+                         foundPaths, 6);
     EXPECT_TRUE(ret);
     EXPECT_EQ(foundPaths.size(), 1U);
 
@@ -159,9 +159,9 @@
 TEST_F(TestUtils, findFiles_in_sub_peci_match)
 {
     std::vector<fs::path> foundPaths;
-    auto ret =
-        findFiles(peciDir / "peci-0", R"(\d+-.+/peci-.+/hwmon/hwmon\d+/name$)",
-                  foundPaths, 5);
+    auto ret = findFiles(peciDir / "peci-0",
+                         R"(\d+-.+/peci-.+/hwmon/hwmon\d+/name$)", foundPaths,
+                         5);
     EXPECT_TRUE(ret);
     EXPECT_EQ(foundPaths.size(), 1U);
 
