clang-format: update whitespace penalty
clang-format-15 seems to end up with a slightly different whitespace
break than clang-format-14 did. Tweak the PenaltyBreakAssignment
to favor not breaking as often, which allows the two to be more
consistent.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I49826e2011bce317b6b82dc985ddd35fa6eef2cb
diff --git a/.clang-format b/.clang-format
index ba9f48d..edcf98e 100644
--- a/.clang-format
+++ b/.clang-format
@@ -85,12 +85,14 @@
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 25
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
diff --git a/example/asio-example.cpp b/example/asio-example.cpp
index 0b23e50..f113dd3 100644
--- a/example/asio-example.cpp
+++ b/example/asio-example.cpp
@@ -297,10 +297,10 @@
}
// test async method call and async send
- auto mesg =
- conn->new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper", "GetSubTree");
+ auto mesg = conn->new_method_call("xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper",
+ "GetSubTree");
static const auto depth = 2;
static const std::vector<std::string> interfaces = {
diff --git a/example/get-all-properties.cpp b/example/get-all-properties.cpp
index 53d2466..8b01258 100644
--- a/example/get-all-properties.cpp
+++ b/example/get-all-properties.cpp
@@ -22,8 +22,8 @@
ioc_(ioc),
bus_(bus), objServer_(objServer)
{
- demo_ =
- objServer_.add_unique_interface(demoObjectPath, demoInterfaceName);
+ demo_ = objServer_.add_unique_interface(demoObjectPath,
+ demoInterfaceName);
demo_->register_property_r<std::string>(
propertyGrettingName, sdbusplus::vtable::property_::const_,
diff --git a/example/list-users.cpp b/example/list-users.cpp
index f7ab475..4dabd40 100644
--- a/example/list-users.cpp
+++ b/example/list-users.cpp
@@ -13,9 +13,9 @@
using namespace sdbusplus;
auto b = bus::new_default_system();
- auto m =
- b.new_method_call("org.freedesktop.login1", "/org/freedesktop/login1",
- "org.freedesktop.login1.Manager", "ListUsers");
+ auto m = b.new_method_call("org.freedesktop.login1",
+ "/org/freedesktop/login1",
+ "org.freedesktop.login1.Manager", "ListUsers");
auto reply = b.call(m);
using return_type =
diff --git a/include/sdbusplus/asio/detail/async_send_handler.hpp b/include/sdbusplus/asio/detail/async_send_handler.hpp
index 9cb7978..f67a749 100644
--- a/include/sdbusplus/asio/detail/async_send_handler.hpp
+++ b/include/sdbusplus/asio/detail/async_send_handler.hpp
@@ -76,9 +76,9 @@
{
using unpack_t = unpack_userdata<CompletionToken>;
auto context = std::make_unique<unpack_t>(std::move(token));
- int ec =
- sd_bus_call_async(bus, nullptr, mesg.get(), &unpack_t::do_unpack,
- context.get(), timeout);
+ int ec = sd_bus_call_async(bus, nullptr, mesg.get(),
+ &unpack_t::do_unpack, context.get(),
+ timeout);
if (ec < 0)
{
auto err =
diff --git a/include/sdbusplus/asio/object_server.hpp b/include/sdbusplus/asio/object_server.hpp
index a8fcc53..ca9b24a 100644
--- a/include/sdbusplus/asio/object_server.hpp
+++ b/include/sdbusplus/asio/object_server.hpp
@@ -69,8 +69,8 @@
template <typename T>
static constexpr bool callbackYields = FirstArgIsYield_v<T>;
template <typename T>
-static constexpr bool callbackWantsMessage = (FirstArgIsMessage_v<T> ||
- SecondArgIsMessage_v<T>);
+static constexpr bool callbackWantsMessage = FirstArgIsMessage_v<T> ||
+ SecondArgIsMessage_v<T>;
namespace details
{
@@ -833,8 +833,8 @@
bool remove_interface(const std::shared_ptr<dbus_interface>& iface)
{
- auto findIface =
- std::find(interfaces_.begin(), interfaces_.end(), iface);
+ auto findIface = std::find(interfaces_.begin(), interfaces_.end(),
+ iface);
if (findIface != interfaces_.end())
{
interfaces_.erase(findIface);
diff --git a/include/sdbusplus/bus.hpp b/include/sdbusplus/bus.hpp
index 11e2d13..2b7b1bd 100644
--- a/include/sdbusplus/bus.hpp
+++ b/include/sdbusplus/bus.hpp
@@ -281,8 +281,8 @@
{
sd_bus_error error = SD_BUS_ERROR_NULL;
sd_bus_message* reply = nullptr;
- int r =
- _intf->sd_bus_call(_bus.get(), m.get(), timeout_us, &error, &reply);
+ int r = _intf->sd_bus_call(_bus.get(), m.get(), timeout_us, &error,
+ &reply);
if (r < 0)
{
throw exception::SdBusError(&error, "sd_bus_call");
diff --git a/test/unpack_properties.cpp b/test/unpack_properties.cpp
index b4a3e32..1a74c79 100644
--- a/test/unpack_properties.cpp
+++ b/test/unpack_properties.cpp
@@ -264,8 +264,8 @@
std::optional<std::string> val1;
std::optional<std::string> val2;
- auto badProperty =
- this->unpackPropertiesCall(this->data, "Key-1", val1, "Key-2", val2);
+ auto badProperty = this->unpackPropertiesCall(this->data, "Key-1", val1,
+ "Key-2", val2);
ASSERT_TRUE(badProperty);
EXPECT_THAT(badProperty->reason, Eq(UnpackErrorReason::wrongType));