clang-format: update to OpenBMC latest

Ignore libmapper, because it is written in C and the CPP style
guidelines are not appropriate.

Ignore subprojects; they can validate their formatting themselves.

Change-Id: Id88dcc49f4176c6443e7f53ca193ca8f3e83a51f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/.clang-format b/.clang-format
index 8c5278e..00e2e25 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: true
+AlwaysBreakTemplateDeclarations: Yes
 BinPackArguments: true
 BinPackParameters: true
 BraceWrapping:
+  AfterCaseLabel:  true
   AfterClass:      true
   AfterControlStatement: true
   AfterEnum:       true
@@ -29,20 +29,29 @@
   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: false
 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
@@ -50,21 +59,25 @@
 IncludeBlocks: Regroup
 IncludeCategories:
   - Regex:           '^[<"](gtest|gmock)'
-    Priority:        5
+    Priority:        7
   - Regex:           '^"config.h"'
     Priority:        -1
-  - Regex:           '^".*\.hpp"'
+  - Regex:           '^".*\.h"'
     Priority:        1
-  - Regex:           '^<.*\.h>'
+  - Regex:           '^".*\.hpp"'
     Priority:        2
-  - Regex:           '^<.*'
+  - Regex:           '^<.*\.h>'
     Priority:        3
-  - Regex:           '.*'
+  - Regex:           '^<.*\.hpp>'
     Priority:        4
+  - Regex:           '^<.*'
+    Priority:        5
+  - Regex:           '.*'
+    Priority:        6
 IndentCaseLabels: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
-KeepEmptyLinesAtTheStartOfBlocks: true
+KeepEmptyLinesAtTheStartOfBlocks: false
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
 MaxEmptyLinesToKeep: 1
@@ -78,13 +91,17 @@
 PenaltyBreakString: 1000
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
-PointerAlignment: Left
 ReflowComments:  true
 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
@@ -92,7 +109,9 @@
 SpacesInCStyleCastParentheses: false
 SpacesInParentheses: false
 SpacesInSquareBrackets: false
-Standard:        Cpp11
+Standard:        Latest
 TabWidth:        4
+UseCRLF: false
 UseTab:          Never
 ...
+
diff --git a/.gitignore b/.gitignore
index 6da54be..0eb2499 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
 build*/
 subprojects/*
 !subprojects/*.wrap
+!subprojects/.clang-format
+
diff --git a/fail-monitor/monitor.hpp b/fail-monitor/monitor.hpp
index df8a30a..4393d99 100644
--- a/fail-monitor/monitor.hpp
+++ b/fail-monitor/monitor.hpp
@@ -51,8 +51,7 @@
             Action action) :
         bus(std::move(sdbusplus::bus::new_default())),
         source(sourceUnit), target(targetUnit), action(action)
-    {
-    }
+    {}
 
     /**
      * Analyzes the source unit to check if it is in a failed state.
diff --git a/libmapper/.clang-format b/libmapper/.clang-format
new file mode 100644
index 0000000..4662692
--- /dev/null
+++ b/libmapper/.clang-format
@@ -0,0 +1,2 @@
+---
+DisableFormat: true
diff --git a/src/associations.cpp b/src/associations.cpp
index 9fd72ab..cc6c723 100644
--- a/src/associations.cpp
+++ b/src/associations.cpp
@@ -1,9 +1,10 @@
 #include "associations.hpp"
 
 #include <boost/algorithm/string/predicate.hpp>
-#include <iostream>
 #include <sdbusplus/exception.hpp>
 
+#include <iostream>
+
 void removeAssociation(const std::string& sourcePath, const std::string& owner,
                        sdbusplus::asio::object_server& server,
                        AssociationMaps& assocMaps)
diff --git a/src/main.cpp b/src/main.cpp
index 7fd2b10..5fb93b2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,18 +5,19 @@
 
 #include <tinyxml2.h>
 
-#include <atomic>
 #include <boost/algorithm/string/predicate.hpp>
 #include <boost/asio/io_context.hpp>
 #include <boost/asio/signal_set.hpp>
 #include <boost/container/flat_map.hpp>
-#include <chrono>
-#include <iomanip>
-#include <iostream>
 #include <sdbusplus/asio/connection.hpp>
 #include <sdbusplus/asio/object_server.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
 
+#include <atomic>
+#include <chrono>
+#include <iomanip>
+#include <iostream>
+
 AssociationMaps associationMaps;
 
 static WhiteBlackList service_whitelist;
@@ -76,8 +77,7 @@
         global_start_time(global_start_time),
         process_start_time(std::chrono::steady_clock::now())
 #endif
-    {
-    }
+    {}
     ~InProgressIntrospect()
     {
         send_introspection_complete_signal(system_bus, process_name);
@@ -461,7 +461,6 @@
             {
                 for (auto& interface_map : object_path.second)
                 {
-
                     if (intersect(interfaces.begin(), interfaces.end(),
                                   interface_map.second.begin(),
                                   interface_map.second.end()))
diff --git a/src/processing.cpp b/src/processing.cpp
index f144b77..19f36a8 100644
--- a/src/processing.cpp
+++ b/src/processing.cpp
@@ -1,6 +1,7 @@
 #include "processing.hpp"
 
 #include <boost/algorithm/string/predicate.hpp>
+
 #include <iostream>
 
 bool getWellKnown(
diff --git a/src/processing.hpp b/src/processing.hpp
index 114b502..0810312 100644
--- a/src/processing.hpp
+++ b/src/processing.hpp
@@ -5,6 +5,7 @@
 
 #include <boost/container/flat_map.hpp>
 #include <boost/container/flat_set.hpp>
+
 #include <cassert>
 #include <string>
 
diff --git a/src/test/associations.cpp b/src/test/associations.cpp
index 73c36ed..4e1b2bd 100644
--- a/src/test/associations.cpp
+++ b/src/test/associations.cpp
@@ -10,8 +10,7 @@
 #include <gtest/gtest.h>
 
 class TestAssociations : public AsioServerClassTest
-{
-};
+{};
 sdbusplus::asio::object_server* TestAssociations::AsioServerClassTest::server =
     nullptr;
 
@@ -100,7 +99,6 @@
 // Verify no associations or endpoints removed when the change is identical
 TEST_F(TestAssociations, checkAssociationEndpointRemovesNoEpRemove)
 {
-
     AssociationPaths newAssocPaths = {
         {DEFAULT_FWD_PATH, {DEFAULT_ENDPOINT}},
         {DEFAULT_REV_PATH, {DEFAULT_SOURCE_PATH}}};
diff --git a/src/test/interfaces_added.cpp b/src/test/interfaces_added.cpp
index ee0e438..20d8716 100644
--- a/src/test/interfaces_added.cpp
+++ b/src/test/interfaces_added.cpp
@@ -9,8 +9,7 @@
 #include <gtest/gtest.h>
 
 class TestInterfacesAdded : public AsioServerClassTest
-{
-};
+{};
 sdbusplus::asio::object_server*
     TestInterfacesAdded::AsioServerClassTest::server = nullptr;
 
diff --git a/src/test/name_change.cpp b/src/test/name_change.cpp
index 95d02af..32ad56c 100644
--- a/src/test/name_change.cpp
+++ b/src/test/name_change.cpp
@@ -5,8 +5,7 @@
 #include <gtest/gtest.h>
 
 class TestNameChange : public AsioServerClassTest
-{
-};
+{};
 sdbusplus::asio::object_server* TestNameChange::AsioServerClassTest::server =
     nullptr;
 
diff --git a/src/types.hpp b/src/types.hpp
index 6ff7cce..0e89852 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -2,8 +2,9 @@
 
 #include <boost/container/flat_map.hpp>
 #include <boost/container/flat_set.hpp>
-#include <memory>
 #include <sdbusplus/asio/object_server.hpp>
+
+#include <memory>
 #include <string>
 #include <tuple>
 #include <vector>
diff --git a/subprojects/.clang-format b/subprojects/.clang-format
new file mode 100644
index 0000000..4662692
--- /dev/null
+++ b/subprojects/.clang-format
@@ -0,0 +1,2 @@
+---
+DisableFormat: true