From eedbc46c16a880fe794c8025a6ee1d5917a3c62e Mon Sep 17 00:00:00 2001 From: Caio Piccirillo Date: Fri, 1 May 2026 10:32:41 -0300 Subject: [PATCH] style: Format --- src/cppfig/configuration.h | 2 +- src/cppfig/cppfig.h | 2 +- src/cppfig/thread_policy.h | 14 +++++++------- test/integration_test.cpp | 4 ++-- test/thread_safety_test.cpp | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/cppfig/configuration.h b/src/cppfig/configuration.h index fdcf041..90e07d4 100644 --- a/src/cppfig/configuration.h +++ b/src/cppfig/configuration.h @@ -5,8 +5,8 @@ #include #include -#include "cppfig/diff.h" #include "cppfig/conf.h" +#include "cppfig/diff.h" #include "cppfig/interface.h" #include "cppfig/logging.h" #include "cppfig/serializer.h" diff --git a/src/cppfig/cppfig.h b/src/cppfig/cppfig.h index 96aa754..7ccf420 100644 --- a/src/cppfig/cppfig.h +++ b/src/cppfig/cppfig.h @@ -1,8 +1,8 @@ #pragma once +#include "cppfig/conf.h" // IWYU pragma: export #include "cppfig/configuration.h" // IWYU pragma: export #include "cppfig/diff.h" // IWYU pragma: export -#include "cppfig/conf.h" // IWYU pragma: export #include "cppfig/interface.h" // IWYU pragma: export #include "cppfig/logging.h" // IWYU pragma: export #include "cppfig/schema.h" // IWYU pragma: export diff --git a/src/cppfig/thread_policy.h b/src/cppfig/thread_policy.h index 412ce33..7e051c8 100644 --- a/src/cppfig/thread_policy.h +++ b/src/cppfig/thread_policy.h @@ -17,16 +17,16 @@ namespace cppfig { /// @endcode struct SingleThreadedPolicy { /// @brief No-op mutex type (lower_case to satisfy C++ BasicLockable/SharedLockable). - struct mutex_type { // NOLINT(readability-identifier-naming) - void lock() {} // NOLINT(readability-identifier-naming) LCOV_EXCL_LINE - void unlock() {} // NOLINT(readability-identifier-naming) LCOV_EXCL_LINE - void lock_shared() {} // NOLINT(readability-identifier-naming) LCOV_EXCL_LINE - void unlock_shared() {} // NOLINT(readability-identifier-naming) LCOV_EXCL_LINE + struct mutex_type { // NOLINT(readability-identifier-naming) + void lock() { } // NOLINT(readability-identifier-naming) LCOV_EXCL_LINE + void unlock() { } // NOLINT(readability-identifier-naming) LCOV_EXCL_LINE + void lock_shared() { } // NOLINT(readability-identifier-naming) LCOV_EXCL_LINE + void unlock_shared() { } // NOLINT(readability-identifier-naming) LCOV_EXCL_LINE }; /// @brief No-op shared (reader) lock (mirrors std::shared_lock). struct shared_lock { // NOLINT(readability-identifier-naming) - explicit shared_lock(mutex_type& /*unused*/) {} + explicit shared_lock(mutex_type& /*unused*/) { } ~shared_lock() = default; shared_lock(const shared_lock&) = delete; @@ -37,7 +37,7 @@ struct SingleThreadedPolicy { /// @brief No-op unique (writer) lock (mirrors std::unique_lock). struct unique_lock { // NOLINT(readability-identifier-naming) - explicit unique_lock(mutex_type& /*unused*/) {} + explicit unique_lock(mutex_type& /*unused*/) { } ~unique_lock() = default; unique_lock(const unique_lock&) = delete; diff --git a/test/integration_test.cpp b/test/integration_test.cpp index 5d1394d..1b46033 100644 --- a/test/integration_test.cpp +++ b/test/integration_test.cpp @@ -492,7 +492,7 @@ TEST_F(ConfigurationIntegrationTest, SaveCreatesParentDirectories) TEST_F(ConfigurationIntegrationTest, CustomTypeToAndFromString) { // Test the ToString and FromString methods on ConfigTraitsFromJsonAdl - Point p { .x=10, .y=20 }; + Point p { .x = 10, .y = 20 }; auto str = ConfigTraits::ToString(p); EXPECT_NE(str.find("10"), std::string::npos); @@ -1010,7 +1010,7 @@ TEST_F(ConfigurationIntegrationTest, SingleThreadedSaveDirectoryCreationFailure) TEST_F(ConfigurationIntegrationTest, ConfigTraitsFromJsonAdlToJson) { - Point p { .x=5, .y=15 }; + Point p { .x = 5, .y = 15 }; auto val = ConfigTraits::Serialize(p); EXPECT_EQ(val["x"], 5); EXPECT_EQ(val["y"], 15); diff --git a/test/thread_safety_test.cpp b/test/thread_safety_test.cpp index a1189ba..89f3c3d 100644 --- a/test/thread_safety_test.cpp +++ b/test/thread_safety_test.cpp @@ -401,7 +401,7 @@ TEST_F(ThreadSafetyTest, ConcurrentReload) // Multiple loaders threads.reserve(2); -for (int t = 0; t < 2; ++t) { + for (int t = 0; t < 2; ++t) { threads.emplace_back([&] { start_latch.arrive_and_wait(); for (int i = 0; i < k_iters; ++i) { @@ -576,7 +576,7 @@ TEST_F(ThreadSafetyTest, StressAllOperationsMixed) // Thread 0-1: Set Counter threads.reserve(2); -for (int t = 0; t < 2; ++t) { + for (int t = 0; t < 2; ++t) { threads.emplace_back([&, t] { start_latch.arrive_and_wait(); for (int i = 0; i < k_iters; ++i) {