clang-format: copy latest and re-format

clang-format-16 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: I61b093f75011417cc9c7acf9605200f4fa429bac
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/pldmtool/oem/ibm/pldm_oem_ibm.cpp b/pldmtool/oem/ibm/pldm_oem_ibm.cpp
index a5eb71a..cdaa2d5 100644
--- a/pldmtool/oem/ibm/pldm_oem_ibm.cpp
+++ b/pldmtool/oem/ibm/pldm_oem_ibm.cpp
@@ -108,8 +108,7 @@
         return {PLDM_ERROR, {}};
     }
 
-    void parseResponseMsg(pldm_msg*, size_t) override
-    {}
+    void parseResponseMsg(pldm_msg*, size_t) override {}
     void exec()
     {
         std::vector<uint8_t> requestMsg(sizeof(pldm_msg_hdr) +
@@ -182,7 +181,7 @@
             startptr += sizeof(filetableData->file_name_length);
 
             fdata["FileName"] = (std::string(
-                reinterpret_cast<char const*>(startptr), nameLength));
+                reinterpret_cast<const char*>(startptr), nameLength));
             startptr += nameLength;
 
             auto fileSize = *(reinterpret_cast<uint32_t*>(startptr));
@@ -209,8 +208,8 @@
     commands.push_back(std::make_unique<GetAlertStatus>(
         "oem_ibm", "getAlertStatus", getAlertStatus));
 
-    auto getFileTable =
-        oem_ibm->add_subcommand("GetFileTable", "get file table");
+    auto getFileTable = oem_ibm->add_subcommand("GetFileTable",
+                                                "get file table");
 
     commands.push_back(std::make_unique<GetFileTable>("oem_ibm", "getFileTable",
                                                       getFileTable));
diff --git a/pldmtool/pldm_base_cmd.cpp b/pldmtool/pldm_base_cmd.cpp
index cbc4d43..ef2a1a5 100644
--- a/pldmtool/pldm_base_cmd.cpp
+++ b/pldmtool/pldm_base_cmd.cpp
@@ -127,9 +127,10 @@
             bitfield8_t b = types[i / 8];
             if (b.byte & (1 << i % 8))
             {
-                auto it = std::find_if(
-                    pldmTypes.begin(), pldmTypes.end(),
-                    [i](const auto& typePair) { return typePair.second == i; });
+                auto it = std::find_if(pldmTypes.begin(), pldmTypes.end(),
+                                       [i](const auto& typePair) {
+                    return typePair.second == i;
+                });
                 if (it != pldmTypes.end())
                 {
                     jarray["PLDM Type"] = it->first;
@@ -175,9 +176,9 @@
         uint8_t cc = 0, transferFlag = 0;
         uint32_t transferHandle = 0;
         ver32_t version;
-        auto rc =
-            decode_get_version_resp(responsePtr, payloadLength, &cc,
-                                    &transferHandle, &transferFlag, &version);
+        auto rc = decode_get_version_resp(responsePtr, payloadLength, &cc,
+                                          &transferHandle, &transferFlag,
+                                          &version);
         if (rc != PLDM_SUCCESS || cc != PLDM_SUCCESS)
         {
             std::cerr << "Response Message Error: "
@@ -187,9 +188,10 @@
         char buffer[16] = {0};
         ver2str(&version, buffer, sizeof(buffer));
         ordered_json data;
-        auto it = std::find_if(
-            pldmTypes.begin(), pldmTypes.end(),
-            [&](const auto& typePair) { return typePair.second == pldmType; });
+        auto it = std::find_if(pldmTypes.begin(), pldmTypes.end(),
+                               [&](const auto& typePair) {
+            return typePair.second == pldmType;
+        });
 
         if (it != pldmTypes.end())
         {
@@ -265,8 +267,8 @@
                                         PLDM_GET_COMMANDS_REQ_BYTES);
         auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
         ver32_t version{0xFF, 0xFF, 0xFF, 0xFF};
-        auto rc =
-            encode_get_commands_req(instanceId, pldmType, version, request);
+        auto rc = encode_get_commands_req(instanceId, pldmType, version,
+                                          request);
         return {rc, requestMsg};
     }
 
@@ -291,9 +293,10 @@
     template <typename CommandMap>
     void printCommand(CommandMap& commandMap, int i, ordered_json& jarray)
     {
-        auto it = std::find_if(
-            commandMap.begin(), commandMap.end(),
-            [i](const auto& typePair) { return typePair.second == i; });
+        auto it = std::find_if(commandMap.begin(), commandMap.end(),
+                               [i](const auto& typePair) {
+            return typePair.second == i;
+        });
         if (it != commandMap.end())
         {
             jarray["PLDM Command Code"] = i;
@@ -346,13 +349,13 @@
     auto base = app.add_subcommand("base", "base type command");
     base->require_subcommand(1);
 
-    auto getPLDMTypes =
-        base->add_subcommand("GetPLDMTypes", "get pldm supported types");
+    auto getPLDMTypes = base->add_subcommand("GetPLDMTypes",
+                                             "get pldm supported types");
     commands.push_back(
         std::make_unique<GetPLDMTypes>("base", "GetPLDMTypes", getPLDMTypes));
 
-    auto getPLDMVersion =
-        base->add_subcommand("GetPLDMVersion", "get version of a certain type");
+    auto getPLDMVersion = base->add_subcommand("GetPLDMVersion",
+                                               "get version of a certain type");
     commands.push_back(std::make_unique<GetPLDMVersion>(
         "base", "GetPLDMVersion", getPLDMVersion));
 
diff --git a/pldmtool/pldm_bios_cmd.cpp b/pldmtool/pldm_bios_cmd.cpp
index bea7690..7c0adc5 100644
--- a/pldmtool/pldm_bios_cmd.cpp
+++ b/pldmtool/pldm_bios_cmd.cpp
@@ -60,9 +60,9 @@
 
         uint8_t seconds, minutes, hours, day, month;
         uint16_t year;
-        auto rc =
-            decode_get_date_time_resp(responsePtr, payloadLength, &cc, &seconds,
-                                      &minutes, &hours, &day, &month, &year);
+        auto rc = decode_get_date_time_resp(responsePtr, payloadLength, &cc,
+                                            &seconds, &minutes, &hours, &day,
+                                            &month, &year);
         if (rc != PLDM_SUCCESS || cc != PLDM_SUCCESS)
         {
             std::cerr << "Response Message Error: "
@@ -191,8 +191,7 @@
         return {PLDM_ERROR, {}};
     }
 
-    void parseResponseMsg(pldm_msg*, size_t) override
-    {}
+    void parseResponseMsg(pldm_msg*, size_t) override {}
 
     std::optional<Table> getBIOSTable(pldm_bios_table_types tableType)
     {
@@ -786,8 +785,8 @@
             return;
         }
 
-        auto attrEntry =
-            findAttrEntryByName(attrName, *attrTable, *stringTable);
+        auto attrEntry = findAttrEntryByName(attrName, *attrTable,
+                                             *stringTable);
         if (attrEntry == nullptr)
         {
             std::cout << "Could not find attribute :" << attrName << std::endl;
@@ -929,8 +928,8 @@
     commands.push_back(
         std::make_unique<GetDateTime>("bios", "GetDateTime", getDateTime));
 
-    auto setDateTime =
-        bios->add_subcommand("SetDateTime", "set host date time");
+    auto setDateTime = bios->add_subcommand("SetDateTime",
+                                            "set host date time");
     commands.push_back(
         std::make_unique<SetDateTime>("bios", "setDateTime", setDateTime));
 
diff --git a/pldmtool/pldm_cmd_helper.cpp b/pldmtool/pldm_cmd_helper.cpp
index 1bee118..cfbf5c0 100644
--- a/pldmtool/pldm_cmd_helper.cpp
+++ b/pldmtool/pldm_cmd_helper.cpp
@@ -95,8 +95,8 @@
         auto reqhdr = reinterpret_cast<const pldm_msg_hdr*>(&requestMsg[2]);
         do
         {
-            ssize_t peekedLength =
-                recv(socketFd(), nullptr, 0, MSG_PEEK | MSG_TRUNC);
+            ssize_t peekedLength = recv(socketFd(), nullptr, 0,
+                                        MSG_PEEK | MSG_TRUNC);
             responseMsg.resize(peekedLength);
             auto recvDataLength =
                 recv(socketFd(), reinterpret_cast<void*>(responseMsg.data()),
@@ -139,8 +139,8 @@
     auto& bus = pldm::utils::DBusHandler::getBus();
     try
     {
-        auto service =
-            pldm::utils::DBusHandler().getService(pldmObjPath, pldmRequester);
+        auto service = pldm::utils::DBusHandler().getService(pldmObjPath,
+                                                             pldmRequester);
         auto method = bus.new_method_call(service.c_str(), pldmObjPath,
                                           pldmRequester, "GetInstanceId");
         method.append(mctp_eid);
diff --git a/pldmtool/pldm_fru_cmd.cpp b/pldmtool/pldm_fru_cmd.cpp
index 5d012da..39e7e51 100644
--- a/pldmtool/pldm_fru_cmd.cpp
+++ b/pldmtool/pldm_fru_cmd.cpp
@@ -100,8 +100,8 @@
                 reinterpret_cast<const pldm_fru_record_data_format*>(p);
             output["FRU Record Set Identifier"] =
                 (int)le16toh(record->record_set_id);
-            output["FRU Record Type"] =
-                typeToString(fruRecordTypes, record->record_type);
+            output["FRU Record Type"] = typeToString(fruRecordTypes,
+                                                     record->record_type);
             output["Number of FRU fields"] = (int)record->num_fru_fields;
             output["Encoding Type for FRU fields"] =
                 typeToString(fruEncodingType, record->encoding_type);
@@ -124,22 +124,22 @@
                                            fruGeneralFieldTypes.end());
                     if (tlv->type == PLDM_FRU_FIELD_TYPE_IANA)
                     {
-                        fruFieldValue =
-                            fruFieldParserU32(tlv->value, tlv->length);
+                        fruFieldValue = fruFieldParserU32(tlv->value,
+                                                          tlv->length);
                     }
                     else if (tlv->type == PLDM_FRU_FIELD_TYPE_MANUFAC_DATE)
                     {
-                        fruFieldValue =
-                            fruFieldParserTimestamp(tlv->value, tlv->length);
+                        fruFieldValue = fruFieldParserTimestamp(tlv->value,
+                                                                tlv->length);
                     }
                     else
                     {
-                        fruFieldValue =
-                            fruFieldValuestring(tlv->value, tlv->length);
+                        fruFieldValue = fruFieldValuestring(tlv->value,
+                                                            tlv->length);
                     }
 
-                    frudata["FRU Field Type"] =
-                        typeToString(FruFieldTypeMap, tlv->type);
+                    frudata["FRU Field Type"] = typeToString(FruFieldTypeMap,
+                                                             tlv->type);
                     frudata["FRU Field Length"] = (int)(tlv->length);
                     frudata["FRU Field Value"] = fruFieldValue;
                     frufielddata.emplace_back(frudata);
@@ -149,8 +149,8 @@
 #ifdef OEM_IBM
                     if (tlv->type == PLDM_OEM_FRU_FIELD_TYPE_RT)
                     {
-                        auto oemIPZValue =
-                            fruFieldValuestring(tlv->value, tlv->length);
+                        auto oemIPZValue = fruFieldValuestring(tlv->value,
+                                                               tlv->length);
 
                         if (populateMaps.find(oemIPZValue) !=
                             populateMaps.end())
@@ -168,21 +168,21 @@
                     }
                     if (tlv->type == PLDM_OEM_FRU_FIELD_TYPE_IANA)
                     {
-                        fruFieldValue =
-                            fruFieldParserU32(tlv->value, tlv->length);
+                        fruFieldValue = fruFieldParserU32(tlv->value,
+                                                          tlv->length);
                     }
                     else if (tlv->type != 2)
                     {
-                        fruFieldValue =
-                            fruFieldIPZParser(tlv->value, tlv->length);
+                        fruFieldValue = fruFieldIPZParser(tlv->value,
+                                                          tlv->length);
                     }
                     else
                     {
-                        fruFieldValue =
-                            fruFieldValuestring(tlv->value, tlv->length);
+                        fruFieldValue = fruFieldValuestring(tlv->value,
+                                                            tlv->length);
                     }
-                    frudata["FRU Field Type"] =
-                        typeToString(FruFieldTypeMap, tlv->type);
+                    frudata["FRU Field Type"] = typeToString(FruFieldTypeMap,
+                                                             tlv->type);
                     frudata["FRU Field Length"] = (int)(tlv->length);
                     frudata["FRU Field Value"] = fruFieldValue;
                     frufielddata.emplace_back(frudata);
@@ -457,13 +457,13 @@
     commands.push_back(std::make_unique<GetFruRecordTableMetadata>(
         "fru", "GetFruRecordTableMetadata", getFruRecordTableMetadata));
 
-    auto getFRURecordByOption =
-        fru->add_subcommand("GetFRURecordByOption", "get FRU Record By Option");
+    auto getFRURecordByOption = fru->add_subcommand("GetFRURecordByOption",
+                                                    "get FRU Record By Option");
     commands.push_back(std::make_unique<GetFRURecordByOption>(
         "fru", "GetFRURecordByOption", getFRURecordByOption));
 
-    auto getFruRecordTable =
-        fru->add_subcommand("GetFruRecordTable", "get FRU Record Table");
+    auto getFruRecordTable = fru->add_subcommand("GetFruRecordTable",
+                                                 "get FRU Record Table");
     commands.push_back(std::make_unique<GetFruRecordTable>(
         "fru", "GetFruRecordTable", getFruRecordTable));
 }
diff --git a/pldmtool/pldm_fw_update_cmd.cpp b/pldmtool/pldm_fw_update_cmd.cpp
index bf03302..87c4d6e 100644
--- a/pldmtool/pldm_fw_update_cmd.cpp
+++ b/pldmtool/pldm_fw_update_cmd.cpp
@@ -613,8 +613,8 @@
 
 void registerCommand(CLI::App& app)
 {
-    auto fwUpdate =
-        app.add_subcommand("fw_update", "firmware update type commands");
+    auto fwUpdate = app.add_subcommand("fw_update",
+                                       "firmware update type commands");
     fwUpdate->require_subcommand(1);
 
     auto getStatus = fwUpdate->add_subcommand("GetStatus", "Status of the FD");
@@ -634,4 +634,4 @@
 
 } // namespace fw_update
 
-} // namespace pldmtool
\ No newline at end of file
+} // namespace pldmtool
diff --git a/pldmtool/pldm_platform_cmd.cpp b/pldmtool/pldm_platform_cmd.cpp
index 4a78763..259ca40 100644
--- a/pldmtool/pldm_platform_cmd.cpp
+++ b/pldmtool/pldm_platform_cmd.cpp
@@ -115,8 +115,8 @@
                 }
 
                 // check for circular references.
-                auto result =
-                    recordsSeen.emplace(recordHandle, prevRecordHandle);
+                auto result = recordsSeen.emplace(recordHandle,
+                                                  prevRecordHandle);
                 if (!result.second)
                 {
                     std::cerr
@@ -149,9 +149,9 @@
                                         PLDM_GET_PDR_REQ_BYTES);
         auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
 
-        auto rc =
-            encode_get_pdr_req(instanceId, recordHandle, 0, PLDM_GET_FIRSTPART,
-                               UINT16_MAX, 0, request, PLDM_GET_PDR_REQ_BYTES);
+        auto rc = encode_get_pdr_req(instanceId, recordHandle, 0,
+                                     PLDM_GET_FIRSTPART, UINT16_MAX, 0, request,
+                                     PLDM_GET_PDR_REQ_BYTES);
         return {rc, requestMsg};
     }
 
@@ -927,8 +927,8 @@
         output["containerID"] = pdr->container_id;
         output["effecterSemanticID"] = pdr->effecter_semantic_id;
         output["effecterInit"] = effecterInit[pdr->effecter_init];
-        output["effecterDescriptionPDR"] =
-            (pdr->has_description_pdr ? true : false);
+        output["effecterDescriptionPDR"] = (pdr->has_description_pdr ? true
+                                                                     : false);
         output["compositeEffecterCount"] =
             unsigned(pdr->composite_effecter_count);
 
@@ -1336,8 +1336,8 @@
     auto platform = app.add_subcommand("platform", "platform type command");
     platform->require_subcommand(1);
 
-    auto getPDR =
-        platform->add_subcommand("GetPDR", "get platform descriptor records");
+    auto getPDR = platform->add_subcommand("GetPDR",
+                                           "get platform descriptor records");
     commands.push_back(std::make_unique<GetPDR>("platform", "getPDR", getPDR));
 
     auto setStateEffecterStates = platform->add_subcommand(
diff --git a/pldmtool/pldmtool.cpp b/pldmtool/pldmtool.cpp
index 5456221..dcd4640 100644
--- a/pldmtool/pldmtool.cpp
+++ b/pldmtool/pldmtool.cpp
@@ -54,8 +54,8 @@
 
 void registerCommand(CLI::App& app)
 {
-    auto raw =
-        app.add_subcommand("raw", "send a raw request and print response");
+    auto raw = app.add_subcommand("raw",
+                                  "send a raw request and print response");
     commands.push_back(std::make_unique<RawOp>("raw", "raw", raw));
 }