pfr-manager: Update to clang-format-10

Update the .clang-format and run the
latest clang-format-10 on existing source.

Tested:
It builds fine locally.

Change-Id: I544bccd48426127ae69ae2fa3b1dbb674889dfe0
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/.clang-format b/.clang-format
index 37469de..ef6f54e 100644
--- a/.clang-format
+++ b/.clang-format
@@ -5,7 +5,7 @@
 AlignAfterOpenBracket: Align
 AlignConsecutiveAssignments: false
 AlignConsecutiveDeclarations: false
-AlignEscapedNewlinesLeft: false
+AlignEscapedNewlines: Right
 AlignOperands:   true
 AlignTrailingComments: true
 AllowAllParametersOfDeclarationOnNextLine: true
@@ -14,13 +14,13 @@
 AllowShortFunctionsOnASingleLine: None
 AllowShortIfStatementsOnASingleLine: false
 AllowShortLoopsOnASingleLine: false
-AlwaysBreakAfterDefinitionReturnType: None
 AlwaysBreakAfterReturnType: None
 AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: false
+AlwaysBreakTemplateDeclarations: Yes
 BinPackArguments: true
 BinPackParameters: true
 BraceWrapping:
+  AfterCaseLabel:  true
   AfterClass:      true
   AfterControlStatement: true
   AfterEnum:       true
@@ -29,25 +29,50 @@
   AfterObjCDeclaration: true
   AfterStruct:     true
   AfterUnion:      true
+  AfterExternBlock: true
   BeforeCatch:     true
   BeforeElse:      true
   IndentBraces:    false
+  SplitEmptyFunction:   false
+  SplitEmptyRecord:     false
+  SplitEmptyNamespace:  false
 BreakBeforeBinaryOperators: None
 BreakBeforeBraces: Custom
 BreakBeforeTernaryOperators: true
 BreakConstructorInitializers: AfterColon
+BreakInheritanceList: AfterColon
+BreakStringLiterals: true
 ColumnLimit:     80
 CommentPragmas:  '^ IWYU pragma:'
+CompactNamespaces: false
 ConstructorInitializerAllOnOneLineOrOnePerLine: false
 ConstructorInitializerIndentWidth: 4
 ContinuationIndentWidth: 4
 Cpp11BracedListStyle: true
-DerivePointerAlignment: true
+DerivePointerAlignment: false
 PointerAlignment: Left
 DisableFormat:   false
 ExperimentalAutoDetectBinPacking: false
 FixNamespaceComments: true
 ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeBlocks: Regroup
+IncludeCategories:
+  - Regex:           '^[<"](gtest|gmock)'
+    Priority:        7
+  - Regex:           '^"config.h"'
+    Priority:        -1
+  - Regex:           '^".*\.h"'
+    Priority:        1
+  - Regex:           '^".*\.hpp"'
+    Priority:        2
+  - Regex:           '^<.*\.h>'
+    Priority:        3
+  - Regex:           '^<.*\.hpp>'
+    Priority:        4
+  - Regex:           '^<.*'
+    Priority:        5
+  - Regex:           '.*'
+    Priority:        6
 IndentCaseLabels: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
@@ -65,12 +90,17 @@
 PenaltyBreakString: 1000
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
-PointerAlignment: Right
 ReflowComments:  true
-SortIncludes:    false
+SortIncludes:    true
+SortUsingDeclarations: true
 SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
 SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
 SpaceBeforeParens: ControlStatements
+SpaceBeforeRangeBasedForLoopColon: true
 SpaceInEmptyParentheses: false
 SpacesBeforeTrailingComments: 1
 SpacesInAngles:  false
@@ -82,3 +112,4 @@
 TabWidth:        4
 UseTab:          Never
 ...
+
diff --git a/libpfr/inc/file.hpp b/libpfr/inc/file.hpp
index 5532169..6079eac 100644
--- a/libpfr/inc/file.hpp
+++ b/libpfr/inc/file.hpp
@@ -18,12 +18,15 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sys/ioctl.h>
 #include <stdio.h>
-#include <experimental/filesystem>
+#include <sys/ioctl.h>
+
 #include <phosphor-logging/log.hpp>
 
-extern "C" {
+#include <experimental/filesystem>
+
+extern "C"
+{
 #include <i2c/smbus.h>
 #include <linux/i2c-dev.h>
 }
diff --git a/libpfr/inc/pfr.hpp b/libpfr/inc/pfr.hpp
index 8bf3082..704d590 100644
--- a/libpfr/inc/pfr.hpp
+++ b/libpfr/inc/pfr.hpp
@@ -43,9 +43,9 @@
 };
 
 std::string toHexString(const uint8_t val);
-std::string getFirmwareVersion(const ImageType &imgType);
-int getProvisioningStatus(bool &ufmLocked, bool &ufmProvisioned);
-int readCpldReg(const ActionType &action, uint8_t &value);
+std::string getFirmwareVersion(const ImageType& imgType);
+int getProvisioningStatus(bool& ufmLocked, bool& ufmProvisioned);
+int readCpldReg(const ActionType& action, uint8_t& value);
 int setBMCBootCheckpoint(const uint8_t checkPoint);
 
 } // namespace pfr
diff --git a/libpfr/inc/spiDev.hpp b/libpfr/inc/spiDev.hpp
index 17a4f63..667318a 100644
--- a/libpfr/inc/spiDev.hpp
+++ b/libpfr/inc/spiDev.hpp
@@ -17,6 +17,7 @@
 #pragma once
 
 #include <stdio.h>
+
 #include <cstring>
 #include <experimental/filesystem>
 
diff --git a/libpfr/src/pfr.cpp b/libpfr/src/pfr.cpp
index 07b7593..6ee48f9 100644
--- a/libpfr/src/pfr.cpp
+++ b/libpfr/src/pfr.cpp
@@ -14,14 +14,17 @@
 // limitations under the License.
 */
 
-#include <unistd.h>
-#include <iostream>
-#include <sstream>
-#include <iomanip>
 #include "pfr.hpp"
+
 #include "file.hpp"
 #include "spiDev.hpp"
 
+#include <unistd.h>
+
+#include <iomanip>
+#include <iostream>
+#include <sstream>
+
 namespace intel
 {
 namespace pfr
diff --git a/service/inc/pfr_mgr.hpp b/service/inc/pfr_mgr.hpp
index 47fc0f4..8a0acf6 100644
--- a/service/inc/pfr_mgr.hpp
+++ b/service/inc/pfr_mgr.hpp
@@ -16,36 +16,37 @@
 
 #pragma once
 
-#include <string>
-#include <sdbusplus/asio/object_server.hpp>
-#include <phosphor-logging/log.hpp>
-#include <boost/asio.hpp>
-
 #include "pfr.hpp"
 
+#include <boost/asio.hpp>
+#include <phosphor-logging/log.hpp>
+#include <sdbusplus/asio/object_server.hpp>
+
+#include <string>
+
 namespace intel
 {
 namespace pfr
 {
 
-static constexpr const char *versionPurposeBMC =
+static constexpr const char* versionPurposeBMC =
     "xyz.openbmc_project.Software.Version.VersionPurpose.BMC";
-static constexpr const char *versionPurposeHost =
+static constexpr const char* versionPurposeHost =
     "xyz.openbmc_project.Software.Version.VersionPurpose.Host";
-static constexpr const char *versionPurposeOther =
+static constexpr const char* versionPurposeOther =
     "xyz.openbmc_project.Software.Version.VersionPurpose.Other";
 
-static constexpr const char *versionStr = "Version";
-static constexpr const char *ufmProvisionedStr = "UfmProvisioned";
-static constexpr const char *ufmLockedStr = "UfmLocked";
+static constexpr const char* versionStr = "Version";
+static constexpr const char* ufmProvisionedStr = "UfmProvisioned";
+static constexpr const char* ufmLockedStr = "UfmLocked";
 
 class PfrVersion
 {
   public:
-    PfrVersion(sdbusplus::asio::object_server &srv_,
-               std::shared_ptr<sdbusplus::asio::connection> &conn_,
-               const std::string &path_, const ImageType &imgType_,
-               const std::string &purpose_);
+    PfrVersion(sdbusplus::asio::object_server& srv_,
+               std::shared_ptr<sdbusplus::asio::connection>& conn_,
+               const std::string& path_, const ImageType& imgType_,
+               const std::string& purpose_);
     ~PfrVersion() = default;
 
     std::shared_ptr<sdbusplus::asio::connection> conn;
@@ -53,7 +54,7 @@
     void updateVersion();
 
   private:
-    sdbusplus::asio::object_server &server;
+    sdbusplus::asio::object_server& server;
     std::shared_ptr<sdbusplus::asio::dbus_interface> versionIface;
     bool internalSet = false;
 
@@ -66,8 +67,8 @@
 class PfrConfig
 {
   public:
-    PfrConfig(sdbusplus::asio::object_server &srv_,
-              std::shared_ptr<sdbusplus::asio::connection> &conn_);
+    PfrConfig(sdbusplus::asio::object_server& srv_,
+              std::shared_ptr<sdbusplus::asio::connection>& conn_);
     ~PfrConfig() = default;
 
     std::shared_ptr<sdbusplus::asio::connection> conn;
@@ -75,7 +76,7 @@
     void updateProvisioningStatus();
 
   private:
-    sdbusplus::asio::object_server &server;
+    sdbusplus::asio::object_server& server;
     std::shared_ptr<sdbusplus::asio::dbus_interface> pfrCfgIface;
     bool internalSet = false;
 
diff --git a/service/src/mainapp.cpp b/service/src/mainapp.cpp
index 9b45ea2..52e0b85 100644
--- a/service/src/mainapp.cpp
+++ b/service/src/mainapp.cpp
@@ -14,10 +14,11 @@
 // limitations under the License.
 */
 
+#include "pfr.hpp"
+#include "pfr_mgr.hpp"
+
 #include <systemd/sd-journal.h>
 
-#include "pfr_mgr.hpp"
-#include "pfr.hpp"
 #include <boost/asio.hpp>
 
 // Caches the last Recovery/Panic Count to
diff --git a/service/src/pfr_mgr.cpp b/service/src/pfr_mgr.cpp
index abc2938..bb31b5c 100644
--- a/service/src/pfr_mgr.cpp
+++ b/service/src/pfr_mgr.cpp
@@ -27,10 +27,10 @@
 std::shared_ptr<sdbusplus::asio::dbus_interface> associationIface;
 std::set<std::tuple<std::string, std::string, std::string>> associations;
 
-PfrVersion::PfrVersion(sdbusplus::asio::object_server &srv_,
-                       std::shared_ptr<sdbusplus::asio::connection> &conn_,
-                       const std::string &path_, const ImageType &imgType_,
-                       const std::string &purpose_) :
+PfrVersion::PfrVersion(sdbusplus::asio::object_server& srv_,
+                       std::shared_ptr<sdbusplus::asio::connection>& conn_,
+                       const std::string& path_, const ImageType& imgType_,
+                       const std::string& purpose_) :
     server(srv_),
     conn(conn_), path(path_), imgType(imgType_), purpose(purpose_)
 {
@@ -43,7 +43,7 @@
     versionIface->register_property(
         versionStr, version,
         // Override set
-        [this](const std::string &req, std::string &propertyValue) {
+        [this](const std::string& req, std::string& propertyValue) {
             if (internalSet)
             {
                 if (req != propertyValue)
@@ -110,8 +110,8 @@
     return;
 }
 
-PfrConfig::PfrConfig(sdbusplus::asio::object_server &srv_,
-                     std::shared_ptr<sdbusplus::asio::connection> &conn_) :
+PfrConfig::PfrConfig(sdbusplus::asio::object_server& srv_,
+                     std::shared_ptr<sdbusplus::asio::connection>& conn_) :
     server(srv_),
     conn(conn_)
 {