From 7a2579bc160c3cfe4c5ea14eafb7d0907a12fbf5 Mon Sep 17 00:00:00 2001 From: Johnny Shaw Date: Sat, 12 Oct 2024 20:10:14 -0600 Subject: [PATCH] cleans up include ordering --- .clang-format | 15 +++++++++------ test/test_Atomic.cpp | 4 ++-- test/test_EmptyOptimizedPair.cpp | 5 +++-- test/test_Integer.cpp | 4 ++-- test/test_Iterator.cpp | 4 ++-- test/test_Locks.cpp | 4 ++-- test/test_Result.cpp | 7 ++++--- test/test_ScopeExit.cpp | 4 ++-- test/test_SharedPtr.cpp | 3 ++- test/test_Span.cpp | 6 +++--- test/test_StdTypeTraits.cpp | 4 ++-- test/test_TypeWrapper.cpp | 4 ++-- test/test_UniqueResource.cpp | 4 ++-- test/test_Utility.cpp | 4 ++-- test/test_Vector.cpp | 4 ++-- 15 files changed, 41 insertions(+), 35 deletions(-) diff --git a/.clang-format b/.clang-format index 6343dca..c7dd177 100644 --- a/.clang-format +++ b/.clang-format @@ -35,18 +35,21 @@ AlwaysBreakTemplateDeclarations: Yes SortIncludes: true IncludeBlocks: Regroup IncludeCategories: - - Regex: '^"radiant/TotallyRad.h"' + - Regex: '^"(gtest|gmock|test)/.*"$' Priority: 0 SortPriority: 0 - - Regex: '^"radiant/.*\.h"' - Priority: 0 + - Regex: '^"radiant/TotallyRad.h"$' + Priority: 1 SortPriority: 1 - - Regex: '^".*\.h"$' + - Regex: '^"radiant/.*\.h"$' Priority: 1 SortPriority: 2 - - Regex: '^<.*>$' - Priority: 1 + - Regex: '^".*\.h"$' + Priority: 2 SortPriority: 3 + - Regex: '^<.*>$' + Priority: 2 + SortPriority: 4 BinPackArguments: false BinPackParameters: false diff --git a/test/test_Atomic.cpp b/test/test_Atomic.cpp index a395754..845816d 100644 --- a/test/test_Atomic.cpp +++ b/test/test_Atomic.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gtest/gtest.h" - #define RAD_REQUIRE_EXPLICIT_ATOMIC_ORDERING 0 +#include "gtest/gtest.h" + #include "radiant/Atomic.h" #include "radiant/Utility.h" diff --git a/test/test_EmptyOptimizedPair.cpp b/test/test_EmptyOptimizedPair.cpp index b452441..5cd6c19 100644 --- a/test/test_EmptyOptimizedPair.cpp +++ b/test/test_EmptyOptimizedPair.cpp @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "radiant/EmptyOptimizedPair.h" - #include "gtest/gtest.h" #include "test/TestAlloc.h" + +#include "radiant/EmptyOptimizedPair.h" + #include struct Empty diff --git a/test/test_Integer.cpp b/test/test_Integer.cpp index 6390c6f..4603a8b 100644 --- a/test/test_Integer.cpp +++ b/test/test_Integer.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "radiant/Integer.h" - #include "gtest/gtest.h" +#include "radiant/Integer.h" + // clang-format off RAD_S_ASSERT(noexcept(rad::i8())); diff --git a/test/test_Iterator.cpp b/test/test_Iterator.cpp index b18de45..516e433 100644 --- a/test/test_Iterator.cpp +++ b/test/test_Iterator.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "radiant/Iterator.h" - #include "gtest/gtest.h" +#include "radiant/Iterator.h" + struct Data { int value; diff --git a/test/test_Locks.cpp b/test/test_Locks.cpp index 54a532c..7d2fecc 100644 --- a/test/test_Locks.cpp +++ b/test/test_Locks.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "radiant/Locks.h" - #include "gtest/gtest.h" +#include "radiant/Locks.h" + struct TestLock { void LockExclusive() noexcept diff --git a/test/test_Result.cpp b/test/test_Result.cpp index c94b17e..6774a69 100644 --- a/test/test_Result.cpp +++ b/test/test_Result.cpp @@ -19,12 +19,13 @@ #define RAD_ENABLE_NOTHROW_DTOR_ASSERTIONS 0 #define RAD_ENABLE_NOTHROW_MOVE_ASSERTIONS 0 -#include "radiant/Result.h" -#include "radiant/Utility.h" - #include "gtest/gtest.h" #include "test/TestMove.h" #include "test/TestThrow.h" + +#include "radiant/Result.h" +#include "radiant/Utility.h" + #include #include diff --git a/test/test_ScopeExit.cpp b/test/test_ScopeExit.cpp index 346e9a3..51c6d09 100644 --- a/test/test_ScopeExit.cpp +++ b/test/test_ScopeExit.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "radiant/ScopeExit.h" - #include "gtest/gtest.h" +#include "radiant/ScopeExit.h" + namespace { diff --git a/test/test_SharedPtr.cpp b/test/test_SharedPtr.cpp index b8afe6b..82f4084 100644 --- a/test/test_SharedPtr.cpp +++ b/test/test_SharedPtr.cpp @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#define RAD_DEFAULT_ALLOCATOR radtest::Allocator + #include "gtest/gtest.h" #include "test/TestAlloc.h" #include "test/TestThrow.h" -#define RAD_DEFAULT_ALLOCATOR radtest::Allocator #include "radiant/SharedPtr.h" diff --git a/test/test_Span.cpp b/test/test_Span.cpp index 9ae4668..b5a76e1 100644 --- a/test/test_Span.cpp +++ b/test/test_Span.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "radiant/Span.h" -#include "radiant/Utility.h" - #include "gtest/gtest.h" #include "test/TestThrow.h" +#include "radiant/Span.h" +#include "radiant/Utility.h" + static constexpr auto g_SpanString = rad::MakeSpan("Span String"); static constexpr const uint8_t g_Bytes[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, diff --git a/test/test_StdTypeTraits.cpp b/test/test_StdTypeTraits.cpp index d147c83..ef26a36 100644 --- a/test/test_StdTypeTraits.cpp +++ b/test/test_StdTypeTraits.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "gtest/gtest.h" + #include "radiant/detail/Meta.h" #include "radiant/detail/StdTypeTraits.h" -#include "gtest/gtest.h" - namespace rad { diff --git a/test/test_TypeWrapper.cpp b/test/test_TypeWrapper.cpp index 90c44a7..56196e8 100644 --- a/test/test_TypeWrapper.cpp +++ b/test/test_TypeWrapper.cpp @@ -19,11 +19,11 @@ #define RAD_ENABLE_NOTHROW_DTOR_ASSERTIONS 0 #define RAD_ENABLE_NOTHROW_MOVE_ASSERTIONS 0 -#include "radiant/TypeWrapper.h" - #include "gtest/gtest.h" #include "test/TestThrow.h" +#include "radiant/TypeWrapper.h" + template using TW = rad::TypeWrapper; using NTO = radtest::NonThrowingObject; diff --git a/test/test_UniqueResource.cpp b/test/test_UniqueResource.cpp index 1b53b67..b73acc2 100644 --- a/test/test_UniqueResource.cpp +++ b/test/test_UniqueResource.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "radiant/UniqueResource.h" - #include "gtest/gtest.h" +#include "radiant/UniqueResource.h" + static int g_IsValidCalls = 0; static int g_CloseCalls = 0; static int g_CloserCalls = 0; diff --git a/test/test_Utility.cpp b/test/test_Utility.cpp index 7c5f080..6feefd3 100644 --- a/test/test_Utility.cpp +++ b/test/test_Utility.cpp @@ -19,11 +19,11 @@ #define RAD_ENABLE_NOTHROW_DTOR_ASSERTIONS 0 #define RAD_ENABLE_NOTHROW_MOVE_ASSERTIONS 0 -#include "radiant/Utility.h" - #include "gtest/gtest.h" #include "test/TestMove.h" +#include "radiant/Utility.h" + RAD_S_ASSERT(noexcept(rad::Forward(rad::DeclVal()))); RAD_S_ASSERT(noexcept(rad::Forward(rad::DeclVal()))); RAD_S_ASSERT(noexcept(rad::Forward(rad::DeclVal()))); diff --git a/test/test_Vector.cpp b/test/test_Vector.cpp index a47c6ab..dc30986 100644 --- a/test/test_Vector.cpp +++ b/test/test_Vector.cpp @@ -19,11 +19,11 @@ #define RAD_ENABLE_NOTHROW_DTOR_ASSERTIONS 0 #define RAD_ENABLE_NOTHROW_MOVE_ASSERTIONS 0 +#define RAD_DEFAULT_ALLOCATOR radtest::Allocator + #include "gtest/gtest.h" #include "test/TestAlloc.h" -#define RAD_DEFAULT_ALLOCATOR radtest::Allocator - #include "radiant/Vector.h" #include