clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp
index 205da96..fd55d89 100644
--- a/redfish-core/src/error_messages.cpp
+++ b/redfish-core/src/error_messages.cpp
@@ -226,21 +226,19 @@
* See header file for more information
* @endinternal
*/
-nlohmann::json actionParameterValueFormatError(const nlohmann::json& arg1,
- std::string_view arg2,
- std::string_view arg3)
+nlohmann::json actionParameterValueFormatError(
+ const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3)
{
- std::string arg1Str = arg1.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg1Str =
+ arg1.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(
redfish::registries::base::Index::actionParameterValueFormatError,
std::to_array<std::string_view>({arg1Str, arg2, arg3}));
}
-void actionParameterValueFormatError(crow::Response& res,
- const nlohmann::json& arg1,
- std::string_view arg2,
- std::string_view arg3)
+void actionParameterValueFormatError(
+ crow::Response& res, const nlohmann::json& arg1, std::string_view arg2,
+ std::string_view arg3)
{
res.result(boost::beast::http::status::bad_request);
addMessageToErrorJson(res.jsonValue,
@@ -254,9 +252,8 @@
* See header file for more information
* @endinternal
*/
-nlohmann::json actionParameterValueNotInList(std::string_view arg1,
- std::string_view arg2,
- std::string_view arg3)
+nlohmann::json actionParameterValueNotInList(
+ std::string_view arg1, std::string_view arg2, std::string_view arg3)
{
return getLog(
redfish::registries::base::Index::actionParameterValueNotInList,
@@ -420,9 +417,8 @@
* See header file for more information
* @endinternal
*/
-nlohmann::json resourceAlreadyExists(std::string_view arg1,
- std::string_view arg2,
- std::string_view arg3)
+nlohmann::json resourceAlreadyExists(
+ std::string_view arg1, std::string_view arg2, std::string_view arg3)
{
return getLog(redfish::registries::base::Index::resourceAlreadyExists,
std::to_array({arg1, arg2, arg3}));
@@ -488,8 +484,8 @@
nlohmann::json propertyValueFormatError(const nlohmann::json& arg1,
std::string_view arg2)
{
- std::string arg1Str = arg1.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg1Str =
+ arg1.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(redfish::registries::base::Index::propertyValueFormatError,
std::to_array<std::string_view>({arg1Str, arg2}));
}
@@ -513,8 +509,8 @@
nlohmann::json propertyValueNotInList(const nlohmann::json& arg1,
std::string_view arg2)
{
- std::string arg1Str = arg1.dump(-1, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg1Str =
+ arg1.dump(-1, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(redfish::registries::base::Index::propertyValueNotInList,
std::to_array<std::string_view>({arg1Str, arg2}));
}
@@ -536,8 +532,8 @@
nlohmann::json propertyValueOutOfRange(const nlohmann::json& arg1,
std::string_view arg2)
{
- std::string arg1Str = arg1.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg1Str =
+ arg1.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(redfish::registries::base::Index::propertyValueOutOfRange,
std::to_array<std::string_view>({arg1Str, arg2}));
}
@@ -813,13 +809,12 @@
* See header file for more information
* @endinternal
*/
-nlohmann::json
- propertyValueResourceConflict(std::string_view arg1,
- const nlohmann::json& arg2,
- const boost::urls::url_view_base& arg3)
+nlohmann::json propertyValueResourceConflict(
+ std::string_view arg1, const nlohmann::json& arg2,
+ const boost::urls::url_view_base& arg3)
{
- std::string arg2Str = arg2.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg2Str =
+ arg2.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(
redfish::registries::base::Index::propertyValueResourceConflict,
@@ -845,8 +840,8 @@
nlohmann::json propertyValueExternalConflict(std::string_view arg1,
const nlohmann::json& arg2)
{
- std::string arg2Str = arg2.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg2Str =
+ arg2.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(
redfish::registries::base::Index::propertyValueExternalConflict,
@@ -871,8 +866,8 @@
nlohmann::json propertyValueIncorrect(std::string_view arg1,
const nlohmann::json& arg2)
{
- std::string arg2Str = arg2.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg2Str =
+ arg2.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(redfish::registries::base::Index::propertyValueIncorrect,
std::to_array<std::string_view>({arg1, arg2Str}));
}
@@ -1005,8 +1000,8 @@
nlohmann::json propertyValueTypeError(const nlohmann::json& arg1,
std::string_view arg2)
{
- std::string arg1Str = arg1.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg1Str =
+ arg1.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(redfish::registries::base::Index::propertyValueTypeError,
std::to_array<std::string_view>({arg1Str, arg2}));
}
@@ -1089,16 +1084,15 @@
nlohmann::json queryParameterValueTypeError(const nlohmann::json& arg1,
std::string_view arg2)
{
- std::string arg1Str = arg1.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg1Str =
+ arg1.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(
redfish::registries::base::Index::queryParameterValueTypeError,
std::to_array<std::string_view>({arg1Str, arg2}));
}
-void queryParameterValueTypeError(crow::Response& res,
- const nlohmann::json& arg1,
- std::string_view arg2)
+void queryParameterValueTypeError(
+ crow::Response& res, const nlohmann::json& arg1, std::string_view arg2)
{
res.result(boost::beast::http::status::bad_request);
addMessageToErrorJson(res.jsonValue,
@@ -1173,9 +1167,8 @@
* See header file for more information
* @endinternal
*/
-nlohmann::json
- sourceDoesNotSupportProtocol(const boost::urls::url_view_base& arg1,
- std::string_view arg2)
+nlohmann::json sourceDoesNotSupportProtocol(
+ const boost::urls::url_view_base& arg1, std::string_view arg2)
{
return getLog(
redfish::registries::base::Index::sourceDoesNotSupportProtocol,
@@ -1439,12 +1432,11 @@
* See header file for more information
* @endinternal
*/
-nlohmann::json actionParameterValueTypeError(const nlohmann::json& arg1,
- std::string_view arg2,
- std::string_view arg3)
+nlohmann::json actionParameterValueTypeError(
+ const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3)
{
- std::string arg1Str = arg1.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg1Str =
+ arg1.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(
redfish::registries::base::Index::actionParameterValueTypeError,
std::to_array<std::string_view>({arg1Str, arg2, arg3}));
@@ -1469,8 +1461,8 @@
nlohmann::json actionParameterValueError(const nlohmann::json& arg1,
std::string_view arg2)
{
- std::string arg1Str = arg1.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg1Str =
+ arg1.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(redfish::registries::base::Index::actionParameterValueError,
std::to_array<std::string_view>({arg1Str, arg2}));
}
@@ -1660,8 +1652,8 @@
nlohmann::json propertyValueModified(std::string_view arg1,
const nlohmann::json& arg2)
{
- std::string arg2Str = arg2.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg2Str =
+ arg2.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(redfish::registries::base::Index::propertyValueModified,
std::to_array<std::string_view>({arg1, arg2Str}));
}
@@ -1701,16 +1693,15 @@
nlohmann::json queryParameterValueFormatError(const nlohmann::json& arg1,
std::string_view arg2)
{
- std::string arg1Str = arg1.dump(2, ' ', true,
- nlohmann::json::error_handler_t::replace);
+ std::string arg1Str =
+ arg1.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
return getLog(
redfish::registries::base::Index::queryParameterValueFormatError,
std::to_array<std::string_view>({arg1Str, arg2}));
}
-void queryParameterValueFormatError(crow::Response& res,
- const nlohmann::json& arg1,
- std::string_view arg2)
+void queryParameterValueFormatError(
+ crow::Response& res, const nlohmann::json& arg1, std::string_view arg2)
{
res.result(boost::beast::http::status::bad_request);
addMessageToErrorJson(res.jsonValue,
@@ -1781,9 +1772,8 @@
* See header file for more information
* @endinternal
*/
-nlohmann::json queryParameterOutOfRange(std::string_view arg1,
- std::string_view arg2,
- std::string_view arg3)
+nlohmann::json queryParameterOutOfRange(
+ std::string_view arg1, std::string_view arg2, std::string_view arg3)
{
return getLog(redfish::registries::base::Index::queryParameterOutOfRange,
std::to_array({arg1, arg2, arg3}));
diff --git a/redfish-core/src/filter_expr_executor.cpp b/redfish-core/src/filter_expr_executor.cpp
index 1e2e41b..a1accaf 100644
--- a/redfish-core/src/filter_expr_executor.cpp
+++ b/redfish-core/src/filter_expr_executor.cpp
@@ -19,46 +19,46 @@
// The following is created by dumping all key names of type
// Edm.DateTimeOffset. While imperfect that it's a hardcoded list, these
// keys don't change that often
- static constexpr auto timeKeys =
- std::to_array<std::string_view>({"AccountExpiration",
- "CalibrationTime",
- "CoefficientUpdateTime",
- "Created",
- "CreatedDate",
- "CreatedTime",
- "CreateTime",
- "DateTime",
- "EndDateTime",
- "EndTime",
- "EventTimestamp",
- "ExpirationDate",
- "FirstOverflowTimestamp",
- "InitialStartTime",
- "InstallDate",
- "LastOverflowTimestamp",
- "LastResetTime",
- "LastStateTime",
- "LastUpdated",
- "LifetimeStartDateTime",
- "LowestReadingTime",
- "MaintenanceWindowStartTime",
- "Modified",
- "PasswordExpiration",
- "PeakReadingTime",
- "PresentedPublicHostKeyTimestamp",
- "ProductionDate",
- "ReadingTime",
- "ReleaseDate",
- "ReservationTime",
- "SensorResetTime",
- "ServicedDate",
- "SetPointUpdateTime",
- "StartDateTime",
- "StartTime",
- "Time",
- "Timestamp",
- "ValidNotAfter",
- "ValidNotBefore"});
+ static constexpr auto timeKeys = std::to_array<std::string_view>(
+ {"AccountExpiration",
+ "CalibrationTime",
+ "CoefficientUpdateTime",
+ "Created",
+ "CreatedDate",
+ "CreatedTime",
+ "CreateTime",
+ "DateTime",
+ "EndDateTime",
+ "EndTime",
+ "EventTimestamp",
+ "ExpirationDate",
+ "FirstOverflowTimestamp",
+ "InitialStartTime",
+ "InstallDate",
+ "LastOverflowTimestamp",
+ "LastResetTime",
+ "LastStateTime",
+ "LastUpdated",
+ "LifetimeStartDateTime",
+ "LowestReadingTime",
+ "MaintenanceWindowStartTime",
+ "Modified",
+ "PasswordExpiration",
+ "PeakReadingTime",
+ "PresentedPublicHostKeyTimestamp",
+ "ProductionDate",
+ "ReadingTime",
+ "ReleaseDate",
+ "ReservationTime",
+ "SensorResetTime",
+ "ServicedDate",
+ "SetPointUpdateTime",
+ "StartDateTime",
+ "StartTime",
+ "Time",
+ "Timestamp",
+ "ValidNotAfter",
+ "ValidNotBefore"});
explicit DateTimeString(std::string_view strvalue)
{
diff --git a/redfish-core/src/registries.cpp b/redfish-core/src/registries.cpp
index 61b27b5..a852f24 100644
--- a/redfish-core/src/registries.cpp
+++ b/redfish-core/src/registries.cpp
@@ -21,8 +21,8 @@
{
std::span<const MessageEntry>::iterator messageIt = std::ranges::find_if(
registry, [&messageKey](const MessageEntry& messageEntry) {
- return std::strcmp(messageEntry.first, messageKey.c_str()) == 0;
- });
+ return std::strcmp(messageEntry.first, messageKey.c_str()) == 0;
+ });
if (messageIt != registry.end())
{
return &messageIt->second;
diff --git a/redfish-core/src/utils/dbus_utils.cpp b/redfish-core/src/utils/dbus_utils.cpp
index b59088a..18535bc 100644
--- a/redfish-core/src/utils/dbus_utils.cpp
+++ b/redfish-core/src/utils/dbus_utils.cpp
@@ -21,11 +21,10 @@
namespace details
{
-void afterSetProperty(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const std::string& redfishPropertyName,
- const nlohmann::json& propertyValue,
- const boost::system::error_code& ec,
- const sdbusplus::message_t& msg)
+void afterSetProperty(
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const std::string& redfishPropertyName, const nlohmann::json& propertyValue,
+ const boost::system::error_code& ec, const sdbusplus::message_t& msg)
{
if (ec)
{