build: update clang-format
Update to the latest OpenBMC clang-format.
Change-Id: I19424fe32f32900d21272e343a5bda8675edbe60
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/.clang-format b/.clang-format
index ea71ad6..52ac0a1 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,15 +29,22 @@
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
@@ -51,17 +58,21 @@
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
@@ -83,8 +94,13 @@
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 +108,7 @@
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
-Standard: Cpp11
+Standard: Latest
TabWidth: 4
UseTab: Never
...
diff --git a/ext_interface.cpp b/ext_interface.cpp
index a5c1c3c..8e6db17 100644
--- a/ext_interface.cpp
+++ b/ext_interface.cpp
@@ -1,6 +1,7 @@
#include <ext_interface.hpp>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/server.hpp>
+
#include <string>
// Mapper
diff --git a/filedescriptor.cpp b/filedescriptor.cpp
index c96249e..068027f 100644
--- a/filedescriptor.cpp
+++ b/filedescriptor.cpp
@@ -19,9 +19,10 @@
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/elog.hpp>
-#include <stdexcept>
#include <xyz/openbmc_project/Common/File/error.hpp>
+#include <stdexcept>
+
namespace openpower
{
namespace util
diff --git a/nmi_interface.cpp b/nmi_interface.cpp
index fcce451..90cf934 100644
--- a/nmi_interface.cpp
+++ b/nmi_interface.cpp
@@ -29,8 +29,7 @@
NMI::NMI(sdbusplus::bus::bus& bus, const char* path) :
Interface(bus, path), bus(bus), objectPath(path)
-{
-}
+{}
void NMI::nMI()
{
diff --git a/phalerror/create_pel.cpp b/phalerror/create_pel.cpp
index ac1fff7..e3e6117 100644
--- a/phalerror/create_pel.cpp
+++ b/phalerror/create_pel.cpp
@@ -5,18 +5,19 @@
#include <libekb.H>
#include <unistd.h>
+#include <phosphor-logging/elog.hpp>
+#include <xyz/openbmc_project/Logging/Create/server.hpp>
+#include <xyz/openbmc_project/Logging/Entry/server.hpp>
+
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <map>
-#include <phosphor-logging/elog.hpp>
#include <stdexcept>
#include <string>
#include <tuple>
#include <vector>
-#include <xyz/openbmc_project/Logging/Create/server.hpp>
-#include <xyz/openbmc_project/Logging/Entry/server.hpp>
namespace openpower
{
diff --git a/phalerror/create_pel.hpp b/phalerror/create_pel.hpp
index b365272..0c6ee42 100644
--- a/phalerror/create_pel.hpp
+++ b/phalerror/create_pel.hpp
@@ -2,6 +2,7 @@
#include <nlohmann/json.hpp>
#include <sdbusplus/bus.hpp>
+
#include <string>
#include <vector>
namespace openpower
diff --git a/phalerror/phal_error.cpp b/phalerror/phal_error.cpp
index 2cd8d5b..5cd8eca 100644
--- a/phalerror/phal_error.cpp
+++ b/phalerror/phal_error.cpp
@@ -1,4 +1,5 @@
-extern "C" {
+extern "C"
+{
#include <libpdbg.h>
}
@@ -10,14 +11,15 @@
#include <libekb.H>
#include <libipl.H>
+#include <nlohmann/json.hpp>
+#include <phosphor-logging/elog.hpp>
+
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <list>
#include <map>
-#include <nlohmann/json.hpp>
-#include <phosphor-logging/elog.hpp>
#include <sstream>
#include <string>
diff --git a/proc_control.cpp b/proc_control.cpp
index 3bdce8b..eca7812 100644
--- a/proc_control.cpp
+++ b/proc_control.cpp
@@ -15,9 +15,6 @@
*/
#include "registration.hpp"
-#include <algorithm>
-#include <functional>
-#include <iostream>
#include <org/open_power/Proc/FSI/error.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/elog.hpp>
@@ -26,6 +23,10 @@
#include <xyz/openbmc_project/Common/File/error.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
+#include <algorithm>
+#include <functional>
+#include <iostream>
+
using namespace openpower::util;
namespace common_error = sdbusplus::xyz::openbmc_project::Common::Error;
diff --git a/procedures/common/cfam_overrides.cpp b/procedures/common/cfam_overrides.cpp
index ea311f5..40738ac 100644
--- a/procedures/common/cfam_overrides.cpp
+++ b/procedures/common/cfam_overrides.cpp
@@ -3,13 +3,14 @@
#include "registration.hpp"
#include "targeting.hpp"
-#include <fstream>
-#include <iostream>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/elog.hpp>
-#include <sstream>
#include <xyz/openbmc_project/Common/error.hpp>
+#include <fstream>
+#include <iostream>
+#include <sstream>
+
/* File /var/lib/obmc/cfam_overrides requires whitespace-separated parameters
Pos Address Data Mask with one register write per line. For example:
0 0x283F 0x12345678 0xF0F0F0F0
diff --git a/procedures/common/cfam_reset.cpp b/procedures/common/cfam_reset.cpp
index 9a09d18..5427381 100644
--- a/procedures/common/cfam_reset.cpp
+++ b/procedures/common/cfam_reset.cpp
@@ -1,10 +1,11 @@
#include <unistd.h>
-#include <chrono>
-#include <fstream>
#include <gpiod.hpp>
#include <phosphor-logging/log.hpp>
#include <registration.hpp>
+
+#include <chrono>
+#include <fstream>
#include <system_error>
#include <thread>
diff --git a/procedures/common/enter_mpreboot.cpp b/procedures/common/enter_mpreboot.cpp
index 48e6ff3..99e559f 100644
--- a/procedures/common/enter_mpreboot.cpp
+++ b/procedures/common/enter_mpreboot.cpp
@@ -21,6 +21,7 @@
#include <unistd.h>
#include <phosphor-logging/log.hpp>
+
#include <system_error>
#include <vector>
diff --git a/procedures/openfsi/scan.cpp b/procedures/openfsi/scan.cpp
index a9583c6..48e00a3 100644
--- a/procedures/openfsi/scan.cpp
+++ b/procedures/openfsi/scan.cpp
@@ -15,12 +15,13 @@
*/
#include "registration.hpp"
-#include <filesystem>
-#include <fstream>
#include <org/open_power/Proc/FSI/error.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
+#include <filesystem>
+#include <fstream>
+
namespace openpower
{
namespace openfsi
diff --git a/procedures/phal/start_host.cpp b/procedures/phal/start_host.cpp
index 21d2d62..b82a584 100644
--- a/procedures/phal/start_host.cpp
+++ b/procedures/phal/start_host.cpp
@@ -1,7 +1,10 @@
-extern "C" {
+extern "C"
+{
#include <libpdbg.h>
}
+#include "attributes_info.H"
+
#include "phalerror/phal_error.hpp"
#include <libekb.H>
@@ -10,8 +13,6 @@
#include <ext_interface.hpp>
#include <phosphor-logging/log.hpp>
#include <registration.hpp>
-
-#include "attributes_info.H"
namespace openpower
{
namespace phal
diff --git a/targeting.cpp b/targeting.cpp
index 37bed58..7b919be 100644
--- a/targeting.cpp
+++ b/targeting.cpp
@@ -18,13 +18,14 @@
#include <endian.h>
-#include <filesystem>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/elog.hpp>
#include <phosphor-logging/log.hpp>
-#include <regex>
#include <xyz/openbmc_project/Common/File/error.hpp>
+#include <filesystem>
+#include <regex>
+
namespace openpower
{
namespace targeting
diff --git a/targeting.hpp b/targeting.hpp
index 9c63f6c..466cb7e 100644
--- a/targeting.hpp
+++ b/targeting.hpp
@@ -29,8 +29,7 @@
*/
Target(size_t position, const std::string& devPath) :
pos(position), cfamPath(devPath)
- {
- }
+ {}
Target() = delete;
~Target() = default;
@@ -92,8 +91,7 @@
Targeting(const std::string& fsiMasterDev, const std::string& fsiSlaveDir);
Targeting() : Targeting(fsiMasterDevPath, fsiSlaveBaseDir)
- {
- }
+ {}
~Targeting() = default;
Targeting(const Targeting&) = default;