Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Cuemon CI/CD Pipeline
on:
pull_request:
branches: [main]
paths-ignore:
- .codecov/**
- .docfx/**
Expand Down
1 change: 1 addition & 0 deletions .nuget/Cuemon.Extensions.Core/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Availability: .NET 9, .NET 8 and .NET Standard 2.0
# Breaking Changes
- REMOVED ConditionExtensions class from the Cuemon.Extensions namespace and moved members to Condition class in the Cuemon.Core assembly (Cuemon namespace)
- REMOVED ValidatorExtensions class from the Cuemon.Extensions namespace and moved members to Validator class in the Cuemon.Core assembly (Cuemon namespace)
- REMOVED ReplaceLineEndings extension method from the StringExtensions class in the Cuemon.Extensions namespace

Version 8.3.2
Availability: .NET 8, .NET 6 and .NET Standard 2.0
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,32 @@ Removed features:
- UserAgentDocumentFilter class from the Cuemon.Extensions.Swashbuckle.AspNetCore namespace (breaking change)
- UserAgentDocumentOptions class from the Cuemon.Extensions.Swashbuckle.AspNetCore namespace (breaking change)
- XPathDocumentExtensions class from the Cuemon.Extensions.Swashbuckle.AspNetCore namespace (breaking change)
- JsonSerializationInputFormatter class from the Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json namespace (breaking change)
- JsonSerializationMvcOptionsSetup class from the Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json namespace (breaking change)
- JsonSerializationOutputFormatter class from the Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json namespace (breaking change)
- JsonSerializerSettingsExtensions class from the Cuemon.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json namespace (breaking change)
- MvcBuilderExtensions class from the Cuemon.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json namespace (breaking change)
- MvcCoreBuilderExtensions class from the Cuemon.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json namespace (breaking change)
- JsonConverterCollectionExtensions class from the Cuemon.Extensions.AspNetCore.Newtonsoft.Json.Converters namespace (breaking change)
- ServiceCollectionExtensions class from the Cuemon.Extensions.AspNetCore.Newtonsoft.Json.Formatters namespace (breaking change)
- ExceptionConverter class from the Cuemon.Extensions.Newtonsoft.Json.Converters namespace (breaking change)
- FailureConverter class from the Cuemon.Extensions.Newtonsoft.Json.Converters namespace (breaking change)
- JsonConverterCollectionExtensions class from the Cuemon.Extensions.Newtonsoft.Json.Converters namespace (breaking change)
- StringFlagsEnumConverter class from the Cuemon.Extensions.Newtonsoft.Json.Converters namespace (breaking change)
- TransientFaultExceptionConverter class from the Cuemon.Extensions.Newtonsoft.Json.Converters namespace (breaking change)
- DynamicContractResolver class from the Cuemon.Extensions.Newtonsoft.Json namespace (breaking change)
- DynamicJsonConverter class from the Cuemon.Extensions.Newtonsoft.Json namespace (breaking change)
- NewtonsoftJsonFormatter class from the Cuemon.Extensions.Newtonsoft.Json.Formatters namespace (breaking change)
- NewtonsoftJsonFormatterOptions class from the Cuemon.Extensions.Newtonsoft.Json.Formatters namespace (breaking change)
- JData class from the Cuemon.Extensions.Newtonsoft.Json namespace (breaking change)
- JDataResult class from the Cuemon.Extensions.Newtonsoft.Json namespace (breaking change)
- JDataResultExtensions class from the Cuemon.Extensions.Newtonsoft.Json namespace (breaking change)
- JsonReaderExtensions class from the Cuemon.Extensions.Newtonsoft.Json namespace (breaking change)
- JsonSerializerSettingsExtensions class from the Cuemon.Extensions.Newtonsoft.Json namespace (breaking change)
- JsonWriterExtensions class from the Cuemon.Extensions.Newtonsoft.Json namespace (breaking change)
- ContractResolverExtensions class from the Cuemon.Extensions.Newtonsoft.Json.Serialization namespace (breaking change)
- ValidatorExtensions class from the Cuemon.Extensions.Newtonsoft.Json namespace (breaking change)
- ReplaceLineEndings extension method from the StringExtensions class in the Cuemon.Extensions namespace (breaking change)


## [8.3.2] - 2024-08-04
Expand Down
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="17.10.0" Condition="$(TargetFramework.StartsWith('net4')) AND '$(IsLinux)' == 'true'" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.console" Version="2.9.0" />
<PackageReference Include="xunit" Version="2.9.1" />
<PackageReference Include="xunit.runner.console" Version="2.9.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -93,6 +93,6 @@
</ItemGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="Codebelt.Extensions.Xunit" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit" Version="9.0.0-preview.4" />
</ItemGroup>
</Project>
33 changes: 0 additions & 33 deletions src/Cuemon.Extensions.Core/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,6 @@ namespace Cuemon.Extensions
/// </summary>
public static class StringExtensions
{
#if NETSTANDARD2_0_OR_GREATER
private static readonly Regex NewLineRegex = new(@"\r\n|\r|\n", RegexOptions.Compiled);

/// <summary>
/// Replaces all newline sequences in the current string with <see cref="Environment.NewLine"/>.
/// </summary>
/// <param name="input">The <see cref="string"/> to extend.</param>
/// <returns>A string whose contents match the current string, but with all newline sequences replaced with <see cref="Environment.NewLine"/>.</returns>
/// <remarks>Shamefully stolen from https://github.com/WebFormsCore/WebFormsCore/blob/main/src/WebFormsCore/Util/StringExtensions.cs to support .NET Standard 2.0.</remarks>
public static string ReplaceLineEndings(this string input)
{
return ReplaceLineEndings(input, Environment.NewLine);
}

/// <summary>
/// Replaces all newline sequences in the current string with <paramref name="replacementText"/>.
/// </summary>
/// <param name="input">The <see cref="string"/> to extend.</param>
/// <param name="replacementText">The text to use as replacement.</param>
/// <returns>A string whose contents match the current string, but with all newline sequences replaced with <paramref name="replacementText"/>.</returns>
/// <remarks>Shamefully stolen from https://github.com/WebFormsCore/WebFormsCore/blob/main/src/WebFormsCore/Util/StringExtensions.cs to support .NET Standard 2.0.</remarks>
/// <exception cref="ArgumentNullException">
/// <paramref name="input"/> cannot be null -or-
/// <paramref name="replacementText"/> cannot be null.
/// </exception>
public static string ReplaceLineEndings(this string input, string replacementText)
{
Validator.ThrowIfNull(input);
Validator.ThrowIfNull(replacementText);
return NewLineRegex.Replace(input, replacementText);
}
#endif

/// <summary>
/// Returns the set difference between <paramref name="second"/> and <paramref name="first"/> or <see cref="string.Empty"/> if no difference.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Codebelt.Extensions.AspNetCore.Newtonsoft.Json" Version="9.0.0-preview.1" />
<PackageReference Include="Meziantou.Xunit.ParallelTestFramework" Version="2.3.0" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json" Version="9.0.0-preview.1" />
<PackageReference Include="Meziantou.Xunit.ParallelTestFramework" Version="2.3.0" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json" Version="9.0.0-preview.1" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Newtonsoft.Json" Version="9.0.0-preview.1" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion test/Cuemon.Data.Tests/Cuemon.Data.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Newtonsoft.Json" Version="9.0.0-preview.1" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.AspNetCore.Newtonsoft.Json" Version="9.0.0-preview.1" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.AspNetCore.Newtonsoft.Json" Version="9.0.0-preview.1" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting.AspNetCore" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
24 changes: 0 additions & 24 deletions test/Cuemon.Extensions.Core.Tests/StringExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
using Cuemon.Collections.Generic;
using Codebelt.Extensions.Xunit;
using Xunit;
Expand All @@ -16,29 +15,6 @@ public StringExtensionsTest(ITestOutputHelper output) : base(output)
{
}

[Fact]
public void ReplaceLineEndings_ShouldReplaceNewLineOccurrences()
{
var lineEndings = "Windows has \r\n (CRLF) and Linux has \n (LF)";

TestOutput.WriteLine($$"""
Before: {{lineEndings}}
After: {{lineEndings.ReplaceLineEndings()}}
""");

TestOutput.WriteLine(RuntimeInformation.OSDescription);
TestOutput.WriteLine(RuntimeInformation.FrameworkDescription);

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Assert.Equal("Windows has \n (CRLF) and Linux has \n (LF)", lineEndings.ReplaceLineEndings());
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Assert.Equal("Windows has \r\n (CRLF) and Linux has \r\n (LF)", lineEndings.ReplaceLineEndings());
}
}

[Fact]
public void Difference_ShouldGetDifference()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.4" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Changelog entry missing for package update.

Please add an entry in CHANGELOG.md documenting the update of Codebelt.Extensions.Xunit.Hosting to version 9.0.0-preview.4. This ensures that the change is properly tracked and communicated.

  • CHANGELOG.md does not include an entry for Codebelt.Extensions.Xunit.Hosting version 9.0.0-preview.4
🔗 Analysis chain

LGTM! Package reference updated as intended.

The update of Codebelt.Extensions.Xunit.Hosting from version 9.0.0-preview.2 to 9.0.0-preview.4 aligns with the PR objectives of updating dependencies.

Please ensure the following:

  1. This new preview version is compatible with other dependencies and the project's requirements.
  2. The changelog has been updated to reflect this change, if not already done.

To verify the compatibility, you can run the following script:

This script will help identify any potential version conflicts or inconsistencies across the project, and remind you to update the changelog if necessary.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any version conflicts or incompatibilities

# Test: Search for other occurrences of Codebelt.Extensions.Xunit packages
echo "Searching for other Codebelt.Extensions.Xunit package references:"
rg --type csproj "PackageReference.*Codebelt\.Extensions\.Xunit" -g "*.csproj"

# Test: Check if all Codebelt.Extensions.Xunit packages are using the same version
echo "Checking for version consistency across Codebelt.Extensions.Xunit packages:"
rg --type csproj "PackageReference.*Codebelt\.Extensions\.Xunit.*Version=\"([^\"]*)\"" -g "*.csproj" --only-matching --replace '$1' | sort | uniq -c

# Test: Check for the presence of a CHANGELOG.md file
echo "Checking for CHANGELOG.md:"
fd -I CHANGELOG.md

Length of output: 689


Script:

#!/bin/bash
# Description: Check for any version conflicts or incompatibilities

# Test: Search for other occurrences of Codebelt.Extensions.Xunit packages
echo "Searching for other Codebelt.Extensions.Xunit package references:"
rg "PackageReference.*Codebelt\.Extensions\.Xunit" -g "*.csproj"

# Test: Check if all Codebelt.Extensions.Xunit packages are using the same version
echo "Checking for version consistency across Codebelt.Extensions.Xunit packages:"
rg "PackageReference.*Codebelt\.Extensions\.Xunit.*Version=\"([^\"]*)\"" -g "*.csproj" --only-matching --replace '$1' | sort | uniq -c

# Test: Check for the presence of a CHANGELOG.md file
echo "Checking for CHANGELOG.md:"
fd -I CHANGELOG.md

Length of output: 6128


Script:

#!/bin/bash
# Description: Verify that CHANGELOG.md includes an entry for the package update

echo "Verifying that CHANGELOG.md includes an entry for Codebelt.Extensions.Xunit.Hosting version 9.0.0-preview.4:"
rg "Codebelt\.Extensions\.Xunit\.Hosting.*9\.0\.0-preview\.4" CHANGELOG.md || echo "No entry found for Codebelt.Extensions.Xunit.Hosting version 9.0.0-preview.4 in CHANGELOG.md."

Length of output: 500

</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.2" />
<PackageReference Include="Codebelt.Extensions.Xunit.Hosting" Version="9.0.0-preview.4" />
</ItemGroup>

</Project>