From 3cffc0718a1f59cf31e90d0c97005d76789fbe6b Mon Sep 17 00:00:00 2001 From: Chris Donnelly Date: Mon, 24 Nov 2025 18:51:29 -0600 Subject: [PATCH 1/2] chore: Move files that contain framework-extension code The files moved need to live in the Light.GuardClauses.FrameworkExtensions namespace, and not the standard Light.GuardClauses namespace. This is so other polyfill libraries like https://github.com/SimonCropp/Polyfill can be used with Light.GuardClauses and not create conflicts. --- .../ContainsBenchmark.cs | 0 .../StringExtensions.Contains.cs} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Code/Light.GuardClauses.Performance/{StringAssertions => FrameworkExtensions}/ContainsBenchmark.cs (100%) rename Code/Light.GuardClauses/{Check.Contains.cs => FrameworkExtensions/StringExtensions.Contains.cs} (100%) diff --git a/Code/Light.GuardClauses.Performance/StringAssertions/ContainsBenchmark.cs b/Code/Light.GuardClauses.Performance/FrameworkExtensions/ContainsBenchmark.cs similarity index 100% rename from Code/Light.GuardClauses.Performance/StringAssertions/ContainsBenchmark.cs rename to Code/Light.GuardClauses.Performance/FrameworkExtensions/ContainsBenchmark.cs diff --git a/Code/Light.GuardClauses/Check.Contains.cs b/Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.Contains.cs similarity index 100% rename from Code/Light.GuardClauses/Check.Contains.cs rename to Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.Contains.cs From 21af1abad5b7076f3bda1353cee1602e13f95477 Mon Sep 17 00:00:00 2001 From: Chris Donnelly Date: Mon, 24 Nov 2025 18:54:37 -0600 Subject: [PATCH 2/2] chore: Modify moved files to new class/namespace This modifies the Contains extension methods to move it to a new namespace. Note this commit is separate from the rename operation in order to minimize the chance that Git loses file history tracking. --- .../FrameworkExtensions/ContainsBenchmark.cs | 2 +- .../FrameworkExtensions/StringExtensions.Contains.cs | 4 ++-- .../FrameworkExtensions/StringExtensions.cs | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.cs diff --git a/Code/Light.GuardClauses.Performance/FrameworkExtensions/ContainsBenchmark.cs b/Code/Light.GuardClauses.Performance/FrameworkExtensions/ContainsBenchmark.cs index 55b4b894..32c9c29e 100644 --- a/Code/Light.GuardClauses.Performance/FrameworkExtensions/ContainsBenchmark.cs +++ b/Code/Light.GuardClauses.Performance/FrameworkExtensions/ContainsBenchmark.cs @@ -1,7 +1,7 @@ using System; using BenchmarkDotNet.Attributes; -namespace Light.GuardClauses.Performance.StringAssertions +namespace Light.GuardClauses.FrameworkExtensions.Performance.StringAssertions { public class ContainsOrdinalBenchmark { diff --git a/Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.Contains.cs b/Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.Contains.cs index 5e5c9f23..703e9be7 100644 --- a/Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.Contains.cs +++ b/Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.Contains.cs @@ -3,9 +3,9 @@ using JetBrains.Annotations; using NotNullAttribute = System.Diagnostics.CodeAnalysis.NotNullAttribute; -namespace Light.GuardClauses; +namespace Light.GuardClauses.FrameworkExtensions; -public static partial class Check +public static partial class StringExtensions { /// /// Checks if the string contains the specified value using the given comparison type. diff --git a/Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.cs b/Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.cs new file mode 100644 index 00000000..d631d79e --- /dev/null +++ b/Code/Light.GuardClauses/FrameworkExtensions/StringExtensions.cs @@ -0,0 +1,7 @@ +namespace Light.GuardClauses.FrameworkExtensions; + +/// +/// Provides extension methods for the class. +/// +// ReSharper disable once RedundantTypeDeclarationBody -- required for Source Code Transformation +public static partial class StringExtensions { }