Update to latest clang format
Update to clang-format-10
Change-Id: I91e46a3b27c7ebd9a4813a19c1a62ac19bc2f0a0
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/.clang-format b/.clang-format
index ea71ad6..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: 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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 821d4c7..d2ab9fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,7 +81,7 @@
externalproject_add (sdbusplus-project PREFIX
${CMAKE_BINARY_DIR}/sdbusplus-project GIT_REPOSITORY
https://github.com/openbmc/sdbusplus.git GIT_TAG
- bed15f0cee4784acdf151cca14efdfb98cb9d397 SOURCE_DIR
+ 80948b815c0fc6f474fc45ad28f6a373a8896831 SOURCE_DIR
${CMAKE_BINARY_DIR}/sdbusplus-src BINARY_DIR
${CMAKE_BINARY_DIR}/sdbusplus-build CONFIGURE_COMMAND
"" BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/sdbusplus-src
diff --git a/include/EntityManager.hpp b/include/EntityManager.hpp
index b9c1b47..a9dab25 100644
--- a/include/EntityManager.hpp
+++ b/include/EntityManager.hpp
@@ -21,10 +21,11 @@
#include <systemd/sd-journal.h>
#include <boost/container/flat_map.hpp>
-#include <iostream>
-#include <list>
#include <nlohmann/json.hpp>
#include <sdbusplus/asio/object_server.hpp>
+
+#include <iostream>
+#include <list>
#include <string>
using DBusProbeObjectT = boost::container::flat_map<
diff --git a/include/Utils.hpp b/include/Utils.hpp
index d3e731f..dd3effd 100644
--- a/include/Utils.hpp
+++ b/include/Utils.hpp
@@ -17,13 +17,14 @@
#pragma once
#include <boost/container/flat_map.hpp>
-#include <filesystem>
-#include <fstream>
-#include <iostream>
#include <nlohmann/json.hpp>
#include <sdbusplus/asio/connection.hpp>
#include <sdbusplus/exception.hpp>
+#include <filesystem>
+#include <fstream>
+#include <iostream>
+
constexpr const char* configurationOutDir = "/var/configuration/";
constexpr const char* versionHashFile = "/var/configuration/version";
constexpr const char* versionFile = "/etc/os-release";
diff --git a/src/EntityManager.cpp b/src/EntityManager.cpp
index 98f24b2..3b2b416 100644
--- a/src/EntityManager.cpp
+++ b/src/EntityManager.cpp
@@ -30,13 +30,14 @@
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
#include <boost/range/iterator_range.hpp>
+#include <nlohmann/json.hpp>
+#include <sdbusplus/asio/connection.hpp>
+#include <sdbusplus/asio/object_server.hpp>
+
#include <filesystem>
#include <fstream>
#include <iostream>
-#include <nlohmann/json.hpp>
#include <regex>
-#include <sdbusplus/asio/connection.hpp>
-#include <sdbusplus/asio/object_server.hpp>
#include <variant>
constexpr const char* configurationDirectory = PACKAGE_DIR "configurations";
constexpr const char* schemaDirectory = PACKAGE_DIR "configurations/schemas";
@@ -505,8 +506,7 @@
std::function<void(FoundDeviceT&)>&& callback) :
_probeCommand(probeCommand),
scan(scanPtr), _callback(std::move(callback))
-{
-}
+{}
PerformProbe::~PerformProbe()
{
FoundDeviceT foundDevs;
@@ -1265,8 +1265,7 @@
_missingConfigurations(missingConfigurations),
_configurations(configurations), objServer(objServerIn),
_callback(std::move(callback))
-{
-}
+{}
void PerformScan::run()
{
boost::container::flat_set<std::string> dbusProbeInterfaces;
diff --git a/src/FruDevice.cpp b/src/FruDevice.cpp
index 8eb34a0..7107a96 100644
--- a/src/FruDevice.cpp
+++ b/src/FruDevice.cpp
@@ -21,9 +21,13 @@
#include <sys/inotify.h>
#include <sys/ioctl.h>
-#include <array>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/container/flat_map.hpp>
+#include <nlohmann/json.hpp>
+#include <sdbusplus/asio/connection.hpp>
+#include <sdbusplus/asio/object_server.hpp>
+
+#include <array>
#include <chrono>
#include <ctime>
#include <filesystem>
@@ -33,10 +37,7 @@
#include <iomanip>
#include <iostream>
#include <limits>
-#include <nlohmann/json.hpp>
#include <regex>
-#include <sdbusplus/asio/connection.hpp>
-#include <sdbusplus/asio/object_server.hpp>
#include <set>
#include <sstream>
#include <string>
@@ -44,7 +45,8 @@
#include <variant>
#include <vector>
-extern "C" {
+extern "C"
+{
#include <i2c/smbus.h>
#include <linux/i2c-dev.h>
}
@@ -745,16 +747,15 @@
}
// this class allows an async response after all i2c devices are discovered
-struct FindDevicesWithCallback
- : std::enable_shared_from_this<FindDevicesWithCallback>
+struct FindDevicesWithCallback :
+ std::enable_shared_from_this<FindDevicesWithCallback>
{
FindDevicesWithCallback(const std::vector<fs::path>& i2cBuses,
BusMap& busmap,
std::function<void(void)>&& callback) :
_i2cBuses(i2cBuses),
_busMap(busmap), _callback(std::move(callback))
- {
- }
+ {}
~FindDevicesWithCallback()
{
_callback();
diff --git a/src/Overlay.cpp b/src/Overlay.cpp
index a625537..edd00f7 100644
--- a/src/Overlay.cpp
+++ b/src/Overlay.cpp
@@ -23,10 +23,11 @@
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
#include <boost/process/child.hpp>
+#include <nlohmann/json.hpp>
+
#include <filesystem>
#include <iomanip>
#include <iostream>
-#include <nlohmann/json.hpp>
#include <regex>
#include <string>
diff --git a/src/Utils.cpp b/src/Utils.cpp
index c92aabc..4e9d4a1 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -25,15 +25,16 @@
#include <boost/algorithm/string/split.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/lexical_cast.hpp>
-#include <filesystem>
-#include <fstream>
-#include <regex>
#include <sdbusplus/bus/match.hpp>
#include <valijson/adapters/nlohmann_json_adapter.hpp>
#include <valijson/schema.hpp>
#include <valijson/schema_parser.hpp>
#include <valijson/validator.hpp>
+#include <filesystem>
+#include <fstream>
+#include <regex>
+
constexpr const char* templateChar = "$";
namespace fs = std::filesystem;
@@ -372,11 +373,9 @@
}
}
catch (std::invalid_argument&)
- {
- }
+ {}
catch (std::out_of_range&)
- {
- }
+ {}
}
// non-hex numbers
else
@@ -387,8 +386,7 @@
keyPair.value() = temp;
}
catch (boost::bad_lexical_cast&)
- {
- }
+ {}
}
return ret;
}
diff --git a/test/test_entity-manager.cpp b/test/test_entity-manager.cpp
index f7f0a9c..71409f7 100644
--- a/test/test_entity-manager.cpp
+++ b/test/test_entity-manager.cpp
@@ -2,6 +2,7 @@
#include <boost/container/flat_map.hpp>
#include <nlohmann/json.hpp>
+
#include <variant>
#include "gtest/gtest.h"