clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I71c8504caaa31ac43ae0f20c002ed081078e3f48
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index a75a2c2..e5530e6 100644
--- a/.clang-format
+++ b/.clang-format
@@ -104,7 +104,7 @@
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyReturnTypeOnItsOwnLine: 150
PenaltyIndentedWhitespace: 1
PointerAlignment: Left
QualifierAlignment: Left
diff --git a/src/entity_manager.cpp b/src/entity_manager.cpp
index 96eb384..84d131b 100644
--- a/src/entity_manager.cpp
+++ b/src/entity_manager.cpp
@@ -116,10 +116,10 @@
return std::nullopt;
}
-static std::shared_ptr<sdbusplus::asio::dbus_interface>
- createInterface(sdbusplus::asio::object_server& objServer,
- const std::string& path, const std::string& interface,
- const std::string& parent, bool checkNull = false)
+static std::shared_ptr<sdbusplus::asio::dbus_interface> createInterface(
+ sdbusplus::asio::object_server& objServer, const std::string& path,
+ const std::string& interface, const std::string& parent,
+ bool checkNull = false)
{
// on first add we have no reason to check for null before add, as there
// won't be any. For dynamically added interfaces, we check for null so that
diff --git a/src/fru_utils.cpp b/src/fru_utils.cpp
index c4b46cf..3ce9ef4 100644
--- a/src/fru_utils.cpp
+++ b/src/fru_utils.cpp
@@ -369,9 +369,9 @@
}
}
-resCodes
- formatIPMIFRU(const std::vector<uint8_t>& fruBytes,
- boost::container::flat_map<std::string, std::string>& result)
+resCodes formatIPMIFRU(
+ const std::vector<uint8_t>& fruBytes,
+ boost::container::flat_map<std::string, std::string>& result)
{
resCodes ret = resCodes::resOK;
if (fruBytes.size() <= fruBlockSize)
@@ -739,8 +739,8 @@
return false;
}
-std::pair<std::vector<uint8_t>, bool>
- readFRUContents(FRUReader& reader, const std::string& errorHelp)
+std::pair<std::vector<uint8_t>, bool> readFRUContents(
+ FRUReader& reader, const std::string& errorHelp)
{
std::array<uint8_t, I2C_SMBUS_BLOCK_MAX> blockData{};
off_t baseOffset = 0x0;
diff --git a/src/fru_utils.hpp b/src/fru_utils.hpp
index 8a117a7..dcd9752 100644
--- a/src/fru_utils.hpp
+++ b/src/fru_utils.hpp
@@ -123,9 +123,9 @@
bool checkLangEng(uint8_t lang);
-resCodes
- formatIPMIFRU(const std::vector<uint8_t>& fruBytes,
- boost::container::flat_map<std::string, std::string>& result);
+resCodes formatIPMIFRU(
+ const std::vector<uint8_t>& fruBytes,
+ boost::container::flat_map<std::string, std::string>& result);
std::vector<uint8_t>& getFRUInfo(const uint16_t& bus, const uint8_t& address);
@@ -157,8 +157,8 @@
/// \param errorHelp and a helper string for failures
/// \return the FRU contents from the file and bool indicating if the FRU Header
/// was found
-std::pair<std::vector<uint8_t>, bool>
- readFRUContents(FRUReader& reader, const std::string& errorHelp);
+std::pair<std::vector<uint8_t>, bool> readFRUContents(
+ FRUReader& reader, const std::string& errorHelp);
/// \brief Validate an IPMI FRU common header
/// \param blockData the bytes comprising the common header
diff --git a/src/overlay.cpp b/src/overlay.cpp
index ddbddb4..2c0cbef 100644
--- a/src/overlay.cpp
+++ b/src/overlay.cpp
@@ -163,12 +163,12 @@
return std::filesystem::exists(dirPath, ec);
}
-static int
- buildDevice(const std::string& name, const std::string& busPath,
- const std::string& parameters, uint64_t bus, uint64_t address,
- const std::string& constructor, const std::string& destructor,
- const devices::createsHWMon hasHWMonDir,
- std::vector<std::string> channelNames, const size_t retries = 5)
+static int buildDevice(
+ const std::string& name, const std::string& busPath,
+ const std::string& parameters, uint64_t bus, uint64_t address,
+ const std::string& constructor, const std::string& destructor,
+ const devices::createsHWMon hasHWMonDir,
+ std::vector<std::string> channelNames, const size_t retries = 5)
{
if (retries == 0U)
{
diff --git a/src/perform_scan.cpp b/src/perform_scan.cpp
index f866b32..73df57d 100644
--- a/src/perform_scan.cpp
+++ b/src/perform_scan.cpp
@@ -28,9 +28,9 @@
// NOLINTBEGIN(cppcoreguidelines-avoid-non-const-global-variables)
extern std::shared_ptr<sdbusplus::asio::connection> systemBus;
extern nlohmann::json lastJson;
-extern void
- propertiesChangedCallback(nlohmann::json& systemConfiguration,
- sdbusplus::asio::object_server& objServer);
+extern void propertiesChangedCallback(
+ nlohmann::json& systemConfiguration,
+ sdbusplus::asio::object_server& objServer);
// NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables)
using GetSubTreeType = std::vector<
@@ -46,10 +46,10 @@
std::string interface;
};
-void
- getInterfaces(const DBusInterfaceInstance& instance,
- const std::vector<std::shared_ptr<PerformProbe>>& probeVector,
- const std::shared_ptr<PerformScan>& scan, size_t retries = 5)
+void getInterfaces(
+ const DBusInterfaceInstance& instance,
+ const std::vector<std::shared_ptr<PerformProbe>>& probeVector,
+ const std::shared_ptr<PerformScan>& scan, size_t retries = 5)
{
if (retries == 0U)
{
@@ -108,10 +108,10 @@
dbusMatches.emplace(path, std::move(match));
}
-static void
- processDbusObjects(std::vector<std::shared_ptr<PerformProbe>>& probeVector,
- const std::shared_ptr<PerformScan>& scan,
- const GetSubTreeType& interfaceSubtree)
+static void processDbusObjects(
+ std::vector<std::shared_ptr<PerformProbe>>& probeVector,
+ const std::shared_ptr<PerformScan>& scan,
+ const GetSubTreeType& interfaceSubtree)
{
for (const auto& [path, object] : interfaceSubtree)
{
diff --git a/src/topology.cpp b/src/topology.cpp
index 168c160..ed827ad 100644
--- a/src/topology.cpp
+++ b/src/topology.cpp
@@ -42,8 +42,8 @@
}
}
-std::unordered_map<std::string, std::vector<Association>>
- Topology::getAssocs(const std::map<Path, BoardName>& boards)
+std::unordered_map<std::string, std::vector<Association>> Topology::getAssocs(
+ const std::map<Path, BoardName>& boards)
{
std::unordered_map<std::string, std::vector<Association>> result;
diff --git a/src/topology.hpp b/src/topology.hpp
index 467a5ca..816704a 100644
--- a/src/topology.hpp
+++ b/src/topology.hpp
@@ -15,8 +15,8 @@
void addBoard(const std::string& path, const std::string& boardType,
const std::string& boardName,
const nlohmann::json& exposesItem);
- std::unordered_map<std::string, std::vector<Association>>
- getAssocs(const std::map<std::string, std::string>& boards);
+ std::unordered_map<std::string, std::vector<Association>> getAssocs(
+ const std::map<std::string, std::string>& boards);
void remove(const std::string& boardName);
private: