clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I84a952aae0e96b2960d8622659902df660d5ddb8
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/test/clock.cpp b/test/clock.cpp
index e004341..5cba35f 100644
--- a/test/clock.cpp
+++ b/test/clock.cpp
@@ -1,14 +1,17 @@
-#include <cerrno>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
+#include <systemd/sd-event.h>
+
 #include <sdeventplus/clock.hpp>
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/exception.hpp>
 #include <sdeventplus/test/sdevent.hpp>
-#include <systemd/sd-event.h>
+
+#include <cerrno>
 #include <type_traits>
 #include <utility>
 
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
 namespace sdeventplus
 {
 namespace
diff --git a/test/event.cpp b/test/event.cpp
index ff574be..b6f5699 100644
--- a/test/event.cpp
+++ b/test/event.cpp
@@ -1,12 +1,14 @@
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include <memory>
-#include <optional>
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/exception.hpp>
 #include <sdeventplus/test/sdevent.hpp>
+
+#include <memory>
+#include <optional>
 #include <type_traits>
 
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
 namespace sdeventplus
 {
 namespace
@@ -118,8 +120,8 @@
 
     void SetUp()
     {
-        event =
-            std::make_unique<Event>(expected_event, std::false_type(), &mock);
+        event = std::make_unique<Event>(expected_event, std::false_type(),
+                                        &mock);
     }
 
     void TearDown()
diff --git a/test/exception.cpp b/test/exception.cpp
index 2c437e4..7685a88 100644
--- a/test/exception.cpp
+++ b/test/exception.cpp
@@ -1,8 +1,10 @@
-#include <gtest/gtest.h>
 #include <sdeventplus/exception.hpp>
+
 #include <string>
 #include <system_error>
 
+#include <gtest/gtest.h>
+
 namespace sdeventplus
 {
 namespace
diff --git a/test/source/base.cpp b/test/source/base.cpp
index 1b2ed1e..f192546 100644
--- a/test/source/base.cpp
+++ b/test/source/base.cpp
@@ -1,21 +1,24 @@
-#include <cerrno>
-#include <functional>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include <memory>
-#include <optional>
+#include <systemd/sd-event.h>
+
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/exception.hpp>
 #include <sdeventplus/internal/sdevent.hpp>
 #include <sdeventplus/source/base.hpp>
 #include <sdeventplus/test/sdevent.hpp>
 #include <sdeventplus/types.hpp>
+
+#include <cerrno>
+#include <functional>
+#include <memory>
+#include <optional>
 #include <string>
-#include <systemd/sd-event.h>
 #include <tuple>
 #include <type_traits>
 #include <utility>
 
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
 namespace sdeventplus
 {
 namespace source
@@ -39,8 +42,7 @@
 
     BaseImpl(const BaseImpl& other, sdeventplus::internal::NoOwn) :
         Base(other, sdeventplus::internal::NoOwn())
-    {
-    }
+    {}
 
     using Base::get_prepare;
 };
@@ -50,8 +52,7 @@
   public:
     BaseImplData(const BaseImpl& base) :
         BaseImpl(base, sdeventplus::internal::NoOwn()), BaseData(base)
-    {
-    }
+    {}
 };
 
 BaseImpl::BaseImpl(const Event& event, sd_event_source* source,
@@ -195,8 +196,8 @@
                     sd_event_source_set_userdata(expected_source, testing::_))
             .WillOnce(DoAll(SaveArg<1>(&userdata), Return(nullptr)));
     }
-    auto source =
-        std::make_unique<BaseImpl>(*event, expected_source, std::false_type());
+    auto source = std::make_unique<BaseImpl>(*event, expected_source,
+                                             std::false_type());
     EXPECT_CALL(mock, sd_event_source_get_userdata(expected_source))
         .WillRepeatedly(Return(userdata));
     EXPECT_FALSE(source->get_prepare());
diff --git a/test/source/child.cpp b/test/source/child.cpp
index 71a8789..0928433 100644
--- a/test/source/child.cpp
+++ b/test/source/child.cpp
@@ -1,17 +1,20 @@
-#include <cerrno>
-#include <functional>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include <memory>
+#include <sys/wait.h>
+#include <systemd/sd-event.h>
+
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/exception.hpp>
 #include <sdeventplus/source/child.hpp>
 #include <sdeventplus/test/sdevent.hpp>
-#include <sys/wait.h>
-#include <systemd/sd-event.h>
+
+#include <cerrno>
+#include <functional>
+#include <memory>
 #include <type_traits>
 #include <utility>
 
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
 namespace sdeventplus
 {
 namespace source
diff --git a/test/source/event.cpp b/test/source/event.cpp
index 0d86617..95a3dc0 100644
--- a/test/source/event.cpp
+++ b/test/source/event.cpp
@@ -1,16 +1,19 @@
-#include <cerrno>
-#include <functional>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include <memory>
+#include <systemd/sd-event.h>
+
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/exception.hpp>
 #include <sdeventplus/source/event.hpp>
 #include <sdeventplus/test/sdevent.hpp>
-#include <systemd/sd-event.h>
+
+#include <cerrno>
+#include <functional>
+#include <memory>
 #include <type_traits>
 #include <utility>
 
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
 namespace sdeventplus
 {
 namespace source
diff --git a/test/source/io.cpp b/test/source/io.cpp
index e8abb82..2a05d1e 100644
--- a/test/source/io.cpp
+++ b/test/source/io.cpp
@@ -1,16 +1,19 @@
-#include <cerrno>
-#include <functional>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include <memory>
+#include <systemd/sd-event.h>
+
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/exception.hpp>
 #include <sdeventplus/source/io.hpp>
 #include <sdeventplus/test/sdevent.hpp>
-#include <systemd/sd-event.h>
+
+#include <cerrno>
+#include <functional>
+#include <memory>
 #include <type_traits>
 #include <utility>
 
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
 namespace sdeventplus
 {
 namespace source
@@ -150,8 +153,8 @@
             EXPECT_CALL(mock, sd_event_source_get_userdata(expected_source))
                 .WillRepeatedly(ReturnPointee(&userdata));
         }
-        io =
-            std::make_unique<IO>(*event, fd, events, [](IO&, int, uint32_t) {});
+        io = std::make_unique<IO>(*event, fd, events,
+                                  [](IO&, int, uint32_t) {});
     }
 
     void TearDown()
diff --git a/test/source/signal.cpp b/test/source/signal.cpp
index 9ac0f67..effd7a3 100644
--- a/test/source/signal.cpp
+++ b/test/source/signal.cpp
@@ -1,17 +1,20 @@
-#include <cerrno>
-#include <functional>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include <memory>
+#include <signal.h>
+#include <systemd/sd-event.h>
+
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/exception.hpp>
 #include <sdeventplus/source/signal.hpp>
 #include <sdeventplus/test/sdevent.hpp>
-#include <signal.h>
-#include <systemd/sd-event.h>
+
+#include <cerrno>
+#include <functional>
+#include <memory>
 #include <type_traits>
 #include <utility>
 
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
 namespace sdeventplus
 {
 namespace source
@@ -81,8 +84,8 @@
     }
     int completions = 0;
     const struct signalfd_siginfo* return_si;
-    Signal::Callback callback = [&](Signal&,
-                                    const struct signalfd_siginfo* si) {
+    Signal::Callback callback =
+        [&](Signal&, const struct signalfd_siginfo* si) {
         return_si = si;
         completions++;
     };
@@ -113,8 +116,8 @@
                                           testing::_, nullptr))
         .WillOnce(Return(-EINVAL));
     int completions = 0;
-    Signal::Callback callback = [&completions](Signal&,
-                                               const struct signalfd_siginfo*) {
+    Signal::Callback callback =
+        [&completions](Signal&, const struct signalfd_siginfo*) {
         completions++;
     };
     EXPECT_THROW(Signal(*event, sig, std::move(callback)), SdEventError);
diff --git a/test/source/time.cpp b/test/source/time.cpp
index 01d4ae2..5cef5d8 100644
--- a/test/source/time.cpp
+++ b/test/source/time.cpp
@@ -1,17 +1,20 @@
-#include <cerrno>
-#include <chrono>
-#include <functional>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include <memory>
+#include <systemd/sd-event.h>
+#include <time.h>
+
 #include <sdeventplus/clock.hpp>
 #include <sdeventplus/exception.hpp>
 #include <sdeventplus/source/time.hpp>
 #include <sdeventplus/test/sdevent.hpp>
-#include <systemd/sd-event.h>
-#include <time.h>
+
+#include <cerrno>
+#include <chrono>
+#include <functional>
+#include <memory>
 #include <utility>
 
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
 namespace sdeventplus
 {
 namespace source
@@ -60,8 +63,8 @@
     const Time<id>::TimePoint expected_time(std::chrono::seconds{2});
     const Time<id>::Accuracy expected_accuracy(std::chrono::milliseconds{50});
     Time<id>::TimePoint saved_time;
-    Time<id>::Callback callback = [&saved_time](Time<id>&,
-                                                Time<id>::TimePoint time) {
+    Time<id>::Callback callback =
+        [&saved_time](Time<id>&, Time<id>::TimePoint time) {
         saved_time = time;
     };
 
diff --git a/test/utility/sdbus.cpp b/test/utility/sdbus.cpp
index dda33c3..39949c1 100644
--- a/test/utility/sdbus.cpp
+++ b/test/utility/sdbus.cpp
@@ -1,7 +1,8 @@
-#include <gtest/gtest.h>
 #include <sdeventplus/source/event.hpp>
 #include <sdeventplus/utility/sdbus.hpp>
 
+#include <gtest/gtest.h>
+
 namespace sdeventplus::utility
 {
 
diff --git a/test/utility/timer.cpp b/test/utility/timer.cpp
index 7cf9113..a2472ed 100644
--- a/test/utility/timer.cpp
+++ b/test/utility/timer.cpp
@@ -1,14 +1,17 @@
-#include <chrono>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include <memory>
-#include <optional>
+#include <systemd/sd-event.h>
+
 #include <sdeventplus/clock.hpp>
 #include <sdeventplus/event.hpp>
 #include <sdeventplus/test/sdevent.hpp>
 #include <sdeventplus/utility/timer.hpp>
+
+#include <chrono>
+#include <memory>
+#include <optional>
 #include <stdexcept>
-#include <systemd/sd-event.h>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
 
 namespace sdeventplus
 {