Conversation
Owner
ptr727
commented
Jan 31, 2026
- Updated XML documentation in LanguageTag.cs to clarify return values and parsing behavior.
- Enhanced LanguageTagBuilder methods to specify that they set subtags without validation.
- Improved normalization and validation methods in LanguageTagParser to ensure null checks are handled properly.
- Added remarks in LogOptions to clarify the effects of setting logger factory and logger after creation.
- Streamlined async file handling in Rfc5646Data to use 'using' statements for better resource management.
- Updated tests to inherit from SingleInstanceFixture for consistent test execution and resource management.
- Refined exception handling in Program.cs to ensure proper logging and cleanup on errors.
- General code cleanup and consistency improvements across various files.
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ptr727 <2061579+ptr727@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…n and validation - Updated XML documentation in LanguageTag.cs to clarify return values and parsing behavior. - Enhanced LanguageTagBuilder methods to specify that they set subtags without validation. - Improved normalization and validation methods in LanguageTagParser to ensure null checks are handled properly. - Added remarks in LogOptions to clarify the effects of setting logger factory and logger after creation. - Streamlined async file handling in Rfc5646Data to use 'using' statements for better resource management. - Updated tests to inherit from SingleInstanceFixture for consistent test execution and resource management. - Refined exception handling in Program.cs to ensure proper logging and cleanup on errors. - General code cleanup and consistency improvements across various files.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the LanguageTags library to improve documentation, validation, and code quality. It includes updates to XML documentation for better clarity, enhanced error handling, async resource management improvements, migration from xUnit v2 to v3, and general code cleanup across the codebase.
Changes:
- Enhanced XML documentation across all public APIs with more detailed parameter descriptions, return value documentation, and usage remarks
- Improved validation and normalization methods in LanguageTagParser to ensure proper null checking with ArgumentNullException
- Updated test infrastructure to use xUnit v3 with assembly-level fixtures and removed unnecessary null-forgiving operators
- Streamlined async file handling using
usingstatements instead ofConfiguredAsyncDisposable - Enhanced exception handling and logging in the LanguageTagsCreate CLI tool
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| LanguageTags/LanguageTag.cs | Updated XML documentation to clarify parsing behavior and return values |
| LanguageTags/LanguageTagBuilder.cs | Enhanced method documentation to specify that builder methods set values without validation |
| LanguageTags/LanguageTagParser.cs | Changed Normalize(LanguageTag) to return non-nullable and added ArgumentNullException checks |
| LanguageTags/LogOptions.cs | Added remarks explaining caching behavior of logger factory and logger properties |
| LanguageTags/Rfc5646Data.cs | Replaced ConfiguredAsyncDisposable with using statements and added XML documentation |
| LanguageTags/Iso6392Data.cs | Replaced ConfiguredAsyncDisposable with using statements and improved documentation |
| LanguageTags/Iso6393Data.cs | Replaced ConfiguredAsyncDisposable with using statements and improved documentation |
| LanguageTags/LanguageLookup.cs | Added parameter documentation to helper methods |
| LanguageTags/Extensions.cs | Simplified logging extension method calls |
| LanguageTags/*DataGen.cs | Added GeneratedCode attributes and XML documentation to generated code |
| LanguageTags/LanguageTags.csproj | Moved GenerateDocumentationFile property and updated Microsoft.SourceLink.GitHub version |
| LanguageTags/.editorconfig | Added suppression for missing XML documentation warnings |
| LanguageTagsTests/Fixture.cs | Refactored to use xUnit v3 AssemblyFixture pattern with SingleInstanceFixture base class |
| LanguageTagsTests/*.cs | Updated test classes to inherit from SingleInstanceFixture and removed null-forgiving operators |
| LanguageTagsTests/LanguageTagsTests.csproj | Migrated from xunit v2.9.3 to xunit.v3 v3.2.2 and updated xunit.analyzers |
| LanguageTagsTests/.editorconfig | Added suppressions for test-specific analyzer warnings |
| LanguageTagsCreate/Program.cs | Added try-catch-finally for better exception handling and resource cleanup |
| LanguageTagsCreate/LoggerFactory.cs | Improved logger initialization to reuse configured Log.Logger when available |
| LanguageTagsCreate/CreateTagData.cs | Replaced ConfiguredAsyncDisposable with using statements |
| LanguageTagsCreate/HttpClientFactory.cs | Simplified null checks using property pattern matching |
| LanguageTagsCreate/Extensions.cs | Simplified logging extension method calls |
| LanguageTagsCreate/CommandLine.cs | Minor formatting improvement for frozen set initialization |
| CODESTYLE.md | Enhanced documentation guidelines with more detailed examples |
| .editorconfig | Updated modifier order and added ReSharper settings |
| LanguageTags.code-workspace | Added new words to spell checker dictionary |
…handling and logging - Removed unused logger options from LoadDataAsync methods in Iso6392Data, Iso6393Data, and Rfc5646Data classes. - Enhanced error handling by throwing InvalidDataException when no data is found during loading. - Updated Find methods in Iso6392Data, Iso6393Data, and Rfc5646Data to throw ArgumentNullException for null inputs. - Modified LanguageTag and LanguageTagBuilder classes to streamline normalization methods. - Improved logging options handling in LogOptions class, ensuring proper fallback mechanisms. - Updated tests for Iso6392Tests, Iso6393Tests, Rfc5646Tests to validate new error handling and logging behavior. - Removed redundant normalization tests from LanguageTagBuilderTests.
- Removed Options class as it was no longer needed for logging configuration. - Updated Rfc5646Data, Iso6392Data, and Iso6393Data classes to use async methods for loading and saving data. - Changed method names from LoadDataAsync and LoadJsonAsync to FromDataAsync and FromJsonAsync for consistency. - Implemented logging directly within data classes using ILogger. - Updated tests to reflect changes in method names and removed references to the Options class. - Revised README to document breaking changes and new usage patterns.
…on breaking changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.