clang-format: copy latest and re-format

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

Change-Id: Idc09d9211b70f7afc008f32e8cb66485ebe0510c
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index d92a3f1..d43e884 100644
--- a/.clang-format
+++ b/.clang-format
@@ -14,26 +14,30 @@
 AllowShortBlocksOnASingleLine: Empty
 AllowShortCaseLabelsOnASingleLine: false
 AllowShortFunctionsOnASingleLine: Empty
-AllowShortIfStatementsOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLambdasOnASingleLine: true
 AllowShortLoopsOnASingleLine: false
 AlwaysBreakAfterReturnType: None
 AlwaysBreakBeforeMultilineStrings: false
 AlwaysBreakTemplateDeclarations: Yes
 BinPackArguments: true
 BinPackParameters: true
+BitFieldColonSpacing: None
 BraceWrapping:
   AfterCaseLabel:  true
   AfterClass:      true
   AfterControlStatement: true
   AfterEnum:       true
+  AfterExternBlock: true
   AfterFunction:   true
   AfterNamespace:  true
   AfterObjCDeclaration: true
   AfterStruct:     true
   AfterUnion:      true
-  AfterExternBlock: true
   BeforeCatch:     true
   BeforeElse:      true
+  BeforeLambdaBody: false
+  BeforeWhile:     false
   IndentBraces:    false
   SplitEmptyFunction:   false
   SplitEmptyRecord:     false
@@ -48,17 +52,16 @@
 ColumnLimit:     80
 CommentPragmas:  '^ IWYU pragma:'
 CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
 ConstructorInitializerIndentWidth: 4
 ContinuationIndentWidth: 4
 Cpp11BracedListStyle: true
-DeriveLineEnding: false
 DerivePointerAlignment: false
-PointerAlignment: Left
 DisableFormat:   false
-ExperimentalAutoDetectBinPacking: false
 FixNamespaceComments: true
-ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
 IncludeBlocks: Regroup
 IncludeCategories:
   - Regex:           '^[<"](gtest|gmock)'
@@ -78,6 +81,7 @@
   - Regex:           '.*'
     Priority:        6
 IndentCaseLabels: true
+IndentExternBlock: NoIndent
 IndentRequiresClause: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
@@ -92,6 +96,7 @@
 ObjCBlockIndentWidth: 2
 ObjCSpaceAfterProperty: false
 ObjCSpaceBeforeProtocolList: true
+PackConstructorInitializers: BinPack
 PenaltyBreakAssignment: 25
 PenaltyBreakBeforeFirstCallParameter: 19
 PenaltyBreakComment: 300
@@ -100,12 +105,13 @@
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
 PenaltyIndentedWhitespace: 0
+PointerAlignment: Left
 QualifierAlignment: Left
 ReferenceAlignment: Left
 ReflowComments:  true
 RequiresClausePosition: OwnLine
 RequiresExpressionIndentation: Keyword
-SortIncludes:    true
+SortIncludes: CaseSensitive
 SortUsingDeclarations: true
 SpaceAfterCStyleCast: false
 SpaceAfterTemplateKeyword: true
@@ -117,7 +123,7 @@
 SpaceBeforeRangeBasedForLoopColon: true
 SpaceInEmptyParentheses: false
 SpacesBeforeTrailingComments: 1
-SpacesInAngles:  false
+SpacesInAngles: Never
 SpacesInContainerLiterals: true
 SpacesInCStyleCastParentheses: false
 SpacesInParentheses: false
diff --git a/src/estoraged.cpp b/src/estoraged.cpp
index 95f3057..b604a7c 100644
--- a/src/estoraged.cpp
+++ b/src/estoraged.cpp
@@ -58,28 +58,26 @@
     volumeInterface->register_method(
         "FormatLuks", [this](const std::vector<uint8_t>& password,
                              Volume::FilesystemType type) {
-            this->formatLuks(password, type);
-        });
-    volumeInterface->register_method("Erase",
-                                     [this](Volume::EraseMethod eraseType) {
-        this->erase(eraseType);
+        this->formatLuks(password, type);
     });
+    volumeInterface->register_method(
+        "Erase",
+        [this](Volume::EraseMethod eraseType) { this->erase(eraseType); });
     volumeInterface->register_method("Lock", [this]() { this->lock(); });
-    volumeInterface->register_method("Unlock",
-                                     [this](std::vector<uint8_t>& password) {
-        this->unlock(password);
-    });
+    volumeInterface->register_method(
+        "Unlock",
+        [this](std::vector<uint8_t>& password) { this->unlock(password); });
     volumeInterface->register_method(
         "ChangePassword", [this](const std::vector<uint8_t>& oldPassword,
                                  const std::vector<uint8_t>& newPassword) {
-            this->changePassword(oldPassword, newPassword);
-        });
+        this->changePassword(oldPassword, newPassword);
+    });
     volumeInterface->register_property_r(
         "Locked", lockedProperty, sdbusplus::vtable::property_::emits_change,
         [this](bool& value) {
         value = this->isLocked();
         return value;
-        });
+    });
 
     /* Add Drive interface. */
     driveInterface = objectServer.add_interface(
@@ -94,7 +92,7 @@
         [this](bool& value) {
         value = this->isLocked();
         return value;
-        });
+    });
 
     driveInterface->register_property_r(
         "EncryptionStatus", encryptionStatus,
@@ -102,7 +100,7 @@
         [this](Drive::DriveEncryptionState& value) {
         value = this->findEncryptionStatus();
         return value;
-        });
+    });
 
     embeddedLocationInterface = objectServer.add_interface(
         objectPath, "xyz.openbmc_project.Inventory.Connector.Embedded");
diff --git a/src/getConfig.cpp b/src/getConfig.cpp
index 79579b1..f752b77 100644
--- a/src/getConfig.cpp
+++ b/src/getConfig.cpp
@@ -43,7 +43,7 @@
         }
 
         self->respData[path] = std::move(data);
-        },
+    },
         owner, path, "org.freedesktop.DBus.Properties", "GetAll",
         emmcConfigInterface);
 }
@@ -75,7 +75,7 @@
                 }
             }
         }
-        },
+    },
         mapper::busName, mapper::path, mapper::interface, mapper::subtree, "/",
         0, std::vector<const char*>(1, emmcConfigInterface));
 }
diff --git a/src/main.cpp b/src/main.cpp
index d278724..e5f9d09 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -102,7 +102,7 @@
                       "REDFISH_MESSAGE_ID",
                       std::string("OpenBMC.0.1.CreateStorageObjects"));
         }
-        });
+    });
     getter->getConfiguration();
 }
 
diff --git a/src/test/erase/pattern_test.cpp b/src/test/erase/pattern_test.cpp
index e8ea6ce..b3cdfee 100644
--- a/src/test/erase/pattern_test.cpp
+++ b/src/test/erase/pattern_test.cpp
@@ -112,47 +112,41 @@
     // test write pattern with short blocks
     EXPECT_CALL(mock, write(_))
         .WillOnce(Invoke([](std::span<const std::byte> x) {
-            std::copy_n(x.begin(), shortData1.size(), shortData1.begin());
-            return shortData1;
-        }))
-        .RetiresOnSaturation();
+        std::copy_n(x.begin(), shortData1.size(), shortData1.begin());
+        return shortData1;
+    })).RetiresOnSaturation();
     EXPECT_CALL(mock, write(_))
         .WillOnce(Invoke([](std::span<const std::byte> x) {
-            std::copy_n(x.begin(), restOfData.size(), restOfData.begin());
-            return restOfData;
-        }))
-        .RetiresOnSaturation();
+        std::copy_n(x.begin(), restOfData.size(), restOfData.begin());
+        return restOfData;
+    })).RetiresOnSaturation();
     EXPECT_CALL(mock, write(_))
         .WillOnce(Invoke([](std::span<const std::byte> x) {
-            std::copy_n(x.begin(), shortData2.size(), shortData2.begin());
-            return shortData2;
-        }))
-        .RetiresOnSaturation();
+        std::copy_n(x.begin(), shortData2.size(), shortData2.begin());
+        return shortData2;
+    })).RetiresOnSaturation();
 
     // test read pattern
     EXPECT_CALL(mock, read(_))
         .WillOnce(Invoke([](std::span<std::byte> x) {
-            std::copy_n(shortData1.begin(), shortData1.size(), x.data());
-            std::span ret(shortData1);
-            return ret;
-        }))
-        .RetiresOnSaturation();
+        std::copy_n(shortData1.begin(), shortData1.size(), x.data());
+        std::span ret(shortData1);
+        return ret;
+    })).RetiresOnSaturation();
 
     EXPECT_CALL(mock, read(_))
         .WillOnce(Invoke([](std::span<std::byte> x) {
-            std::copy_n(restOfData.begin(), restOfData.size(), x.data());
-            std::span ret(restOfData);
-            return ret;
-        }))
-        .RetiresOnSaturation();
+        std::copy_n(restOfData.begin(), restOfData.size(), x.data());
+        std::span ret(restOfData);
+        return ret;
+    })).RetiresOnSaturation();
 
     EXPECT_CALL(mock, read(_))
         .WillOnce(Invoke([](std::span<std::byte> x) {
-            std::copy_n(shortData2.begin(), shortData2.size(), x.data());
-            std::span ret(shortData2);
-            return ret;
-        }))
-        .RetiresOnSaturation();
+        std::copy_n(shortData2.begin(), shortData2.size(), x.data());
+        std::span ret(shortData2);
+        return ret;
+    })).RetiresOnSaturation();
 
     EXPECT_NO_THROW(pass.writePattern(size, mock));
     EXPECT_NO_THROW(pass.verifyPattern(size, mock));