-
-
Notifications
You must be signed in to change notification settings - Fork 14
Version 5 #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 5 #149
Conversation
There was a problem hiding this 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;
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…lugify into chadt/revised-version
There was a problem hiding this 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(); | ||
| [ |
Copilot
AI
Mar 18, 2025
There was a problem hiding this comment.
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[] { ... }).
| [ | |
| new char[] | |
| { |
| private readonly HashSet<char> _allowedChars = [.. _allowedCharsArray]; | ||
|
|
Copilot
AI
Mar 18, 2025
There was a problem hiding this comment.
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)).
| private readonly HashSet<char> _allowedChars = [.. _allowedCharsArray]; | |
| private readonly HashSet<char> _allowedChars = new HashSet<char>(_allowedCharsArray); |
No description provided.