Skip to content

Conversation

@ctolkien
Copy link
Owner

No description provided.

@ctolkien ctolkien requested a review from Copilot March 12, 2025 06:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/Slugify.Core/SlugHelper.cs:2

  • The removal of 'using System.Globalization;' may lead to errors because NormalizationForm.FormD is used in the code. Please re-add 'using System.Globalization;' to ensure proper functionality.
using System.Text.RegularExpressions;

@ctolkien ctolkien requested a review from Copilot March 18, 2025 10:44
@ctolkien ctolkien merged commit 5707e0e into main Mar 18, 2025
4 checks passed
@ctolkien ctolkien deleted the chadt/revised-version branch March 18, 2025 10:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces Version 5 with performance improvements and API changes in the Slugify library. Key changes include:

  • Updated documentation in README.md to explain the changes from version 4.x to 5.x, including the new usage of a Regex object for DeniedCharactersRegex and renaming AllowedChars to AllowedCharacters.
  • Modifications to the public API and interface (ISlugHelper.cs) to include a new configuration property and enhanced XML documentation.
  • Updates to benchmarks and configuration classes to support the new API changes and improved performance, including changes in initialization syntax.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Updated upgrade instructions and renamed properties for clarity and performance notes.
src/Slugify.Core/ISlugHelper.cs Revised documentation and property/method comments to align with the new configuration usage.
tests/Slugify.Core.Benchmarks/Program.cs Adjusted benchmarks to use the new configuration APIs and introduced a generated regex helper.
tests/Slugify.Core.Benchmarks/BenchmarkDotNet.Artifacts/results/Slugify.Core.Benchmarks.SlugifyBenchmarks-report-github.md Updated benchmark report with new framework and SDK version details.
src/Slugify.Core/SlugHelperConfiguration.cs Changed allowed characters initialization syntax and updated accessors following the renaming of AllowedChars.
src/Slugify.Core/SlugHelper.cs Simplified GenerateSlug implementation with updated string replacement and removal logic to support the new configuration options.

"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"0123456789" +
"-._").ToCharArray();
[
Copy link

Copilot AI Mar 18, 2025

Choose a reason for hiding this comment

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

The array initializer syntax using square brackets is invalid in C#. Replace the square brackets with curly braces and use the proper syntax (e.g., new char[] { ... }).

Suggested change
[
new char[]
{

Copilot uses AI. Check for mistakes.
Comment on lines +23 to 24
private readonly HashSet<char> _allowedChars = [.. _allowedCharsArray];

Copy link

Copilot AI Mar 18, 2025

Choose a reason for hiding this comment

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

The syntax '[.. _allowedCharsArray]' is not valid in C#. Consider initializing the HashSet using the standard constructor with the array (e.g., new HashSet(_allowedCharsArray)).

Suggested change
private readonly HashSet<char> _allowedChars = [.. _allowedCharsArray];
private readonly HashSet<char> _allowedChars = new HashSet<char>(_allowedCharsArray);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants