From 674280c14364b4245be8599a2e1ad9767b3e91ca 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 | 3 ++- test/test_Integer.cpp | 4 ++-- test/test_Iterator.cpp | 4 ++-- test/test_Locks.cpp | 4 ++-- test/test_Result.cpp | 3 ++- test/test_ScopeExit.cpp | 4 ++-- test/test_SharedPtr.cpp | 8 +++++--- test/test_Span.cpp | 3 ++- test/test_StdTypeTraits.cpp | 4 ++-- test/test_TypeWrapper.cpp | 3 ++- test/test_UniqueResource.cpp | 4 ++-- test/test_Utility.cpp | 3 ++- test/test_Vector.cpp | 6 +++--- 15 files changed, 41 insertions(+), 31 deletions(-) diff --git a/.clang-format b/.clang-format index 6343dca..68a98cd 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)/.*"$' 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..3a31992 100644 --- a/test/test_EmptyOptimizedPair.cpp +++ b/test/test_EmptyOptimizedPair.cpp @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "gtest/gtest.h" + #include "radiant/EmptyOptimizedPair.h" -#include "gtest/gtest.h" #include "test/TestAlloc.h" #include 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..06f560b 100644 --- a/test/test_Result.cpp +++ b/test/test_Result.cpp @@ -19,10 +19,11 @@ #define RAD_ENABLE_NOTHROW_DTOR_ASSERTIONS 0 #define RAD_ENABLE_NOTHROW_MOVE_ASSERTIONS 0 +#include "gtest/gtest.h" + #include "radiant/Result.h" #include "radiant/Utility.h" -#include "gtest/gtest.h" #include "test/TestMove.h" #include "test/TestThrow.h" #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..ca2aeca 100644 --- a/test/test_SharedPtr.cpp +++ b/test/test_SharedPtr.cpp @@ -12,13 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gtest/gtest.h" -#include "test/TestAlloc.h" -#include "test/TestThrow.h" #define RAD_DEFAULT_ALLOCATOR radtest::Allocator +#include "gtest/gtest.h" + #include "radiant/SharedPtr.h" +#include "test/TestAlloc.h" +#include "test/TestThrow.h" + namespace sptestobjs { // clang-format off diff --git a/test/test_Span.cpp b/test/test_Span.cpp index 9ae4668..c77b052 100644 --- a/test/test_Span.cpp +++ b/test/test_Span.cpp @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "gtest/gtest.h" + #include "radiant/Span.h" #include "radiant/Utility.h" -#include "gtest/gtest.h" #include "test/TestThrow.h" static constexpr auto g_SpanString = rad::MakeSpan("Span String"); 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..611c34b 100644 --- a/test/test_TypeWrapper.cpp +++ b/test/test_TypeWrapper.cpp @@ -19,9 +19,10 @@ #define RAD_ENABLE_NOTHROW_DTOR_ASSERTIONS 0 #define RAD_ENABLE_NOTHROW_MOVE_ASSERTIONS 0 +#include "gtest/gtest.h" + #include "radiant/TypeWrapper.h" -#include "gtest/gtest.h" #include "test/TestThrow.h" template 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..77a8876 100644 --- a/test/test_Utility.cpp +++ b/test/test_Utility.cpp @@ -19,9 +19,10 @@ #define RAD_ENABLE_NOTHROW_DTOR_ASSERTIONS 0 #define RAD_ENABLE_NOTHROW_MOVE_ASSERTIONS 0 +#include "gtest/gtest.h" + #include "radiant/Utility.h" -#include "gtest/gtest.h" #include "test/TestMove.h" RAD_S_ASSERT(noexcept(rad::Forward(rad::DeclVal()))); diff --git a/test/test_Vector.cpp b/test/test_Vector.cpp index a47c6ab..6174cb8 100644 --- a/test/test_Vector.cpp +++ b/test/test_Vector.cpp @@ -19,13 +19,13 @@ #define RAD_ENABLE_NOTHROW_DTOR_ASSERTIONS 0 #define RAD_ENABLE_NOTHROW_MOVE_ASSERTIONS 0 -#include "gtest/gtest.h" -#include "test/TestAlloc.h" - #define RAD_DEFAULT_ALLOCATOR radtest::Allocator +#include "gtest/gtest.h" + #include "radiant/Vector.h" +#include "test/TestAlloc.h" #include struct VecTestStats