Skip to content

Enhance language tag functionality with normalization, validation, and equality checks#70

Merged
ptr727 merged 2 commits intodevelopfrom
copilot
Jan 30, 2026
Merged

Enhance language tag functionality with normalization, validation, and equality checks#70
ptr727 merged 2 commits intodevelopfrom
copilot

Conversation

@ptr727
Copy link
Owner

@ptr727 ptr727 commented Jan 30, 2026

  • Added normalization methods for ExtensionTag and PrivateUseTag to ensure consistent casing and ordering of tags.
  • Implemented equality checks and hash code generation for ExtensionTag and PrivateUseTag.
  • Updated LanguageTagBuilder to throw an exception for empty extension tags.
  • Enhanced validation in LanguageTagParser to reject whitespace in extension tags.
  • Added tests to verify new behaviors and ensure robustness.

…d equality checks

- Added normalization methods for ExtensionTag and PrivateUseTag to ensure consistent casing and ordering of tags.
- Implemented equality checks and hash code generation for ExtensionTag and PrivateUseTag.
- Updated LanguageTagBuilder to throw an exception for empty extension tags.
- Enhanced validation in LanguageTagParser to reject whitespace in extension tags.
- Added tests to verify new behaviors and ensure robustness.
Copilot AI review requested due to automatic review settings January 30, 2026 03:05
@ptr727 ptr727 enabled auto-merge (squash) January 30, 2026 03:06
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 enhances the language tag functionality by adding proper equality semantics, normalization capabilities, and improved validation for extension and private use tags. The changes also include a bug fix for exception handling in the HTTP client resilience policies and removal of unused code.

Changes:

  • Added case-insensitive equality comparison and hash code generation for ExtensionTag and PrivateUseTag records
  • Enhanced validation to reject whitespace in extension tags and empty extension collections
  • Fixed HTTP client resilience handler to properly handle exceptions in addition to unsuccessful status codes
  • Removed unused helper methods from Program.cs

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
LanguageTags/LanguageTag.cs Implemented Equals() and GetHashCode() methods for ExtensionTag and PrivateUseTag to support case-insensitive, element-wise comparison
LanguageTags/LanguageTagParser.cs Enhanced ValidateExtension() to check for whitespace characters and added empty extension validation
LanguageTags/LanguageTagBuilder.cs Added validation to throw ArgumentException when attempting to add empty extension tag collections
LanguageTagsTests/LanguageTagTests.cs Updated tests to verify case-insensitive equality and removed unused System.Linq import
LanguageTagsTests/LanguageTagParserTests.cs Added test case for extension tag with whitespace validation
LanguageTagsTests/LanguageTagBuilderTests.cs Added tests for empty extension validation and whitespace rejection
LanguageTagsCreate/HttpClientFactory.cs Fixed resilience handler to check for exceptions in addition to unsuccessful HTTP status codes
LanguageTagsCreate/Program.cs Removed unused GetCommandLineOptions() and GetCancellationToken() methods

@ptr727 ptr727 merged commit ed2b5ab into develop Jan 30, 2026
8 checks passed
@ptr727 ptr727 deleted the copilot branch January 30, 2026 03:12
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.

1 participant