-
Notifications
You must be signed in to change notification settings - Fork 0
V8.4.0/migrate from cuemon #1
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
Conversation
WalkthroughThe changes involve a significant rebranding and restructuring of a .NET project, transitioning from "ClassLibrary1" to "Codebelt.Extensions.Globalization." Key modifications include updates to Docker configurations, project files, documentation, and the introduction of new classes and methods that enhance the functionality of the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
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.
Actionable comments posted: 22
🧹 Outside diff range and nitpick comments (18)
.docfx/PublishDocfxImage.ps1 (2)
2-2: LGTM! Consider using environment variables for flexibility.The Docker tag command has been successfully updated to reflect the new project name and repository. This change aligns well with the rebranding efforts mentioned in the PR objectives.
For improved flexibility and easier maintenance, consider using environment variables for the repository URL and image name. For example:
$REPO_URL = "jcr.codebelt.net/geekle" $IMAGE_NAME = "globalization-docfx" docker tag ${IMAGE_NAME}:$version ${REPO_URL}/${IMAGE_NAME}:$versionThis approach would make it easier to update these values in the future if needed.
3-3: LGTM! Update for consistency with previous suggestion.The Docker push command has been correctly updated to match the changes in the tag command, maintaining consistency in the image naming and repository.
For consistency with the previous suggestion, consider updating this line as well:
docker push ${REPO_URL}/${IMAGE_NAME}:$versionThis change would make the script more maintainable and less prone to errors if the repository URL or image name needs to be updated in the future.
.docfx/BuildDocfxImage.ps1 (1)
3-3: LGTM! Docker image tag updated correctly.The Docker image tag has been successfully updated to reflect the project's rebranding from "ClassLibrary1" to "Codebelt.Extensions.Globalization". The new tag
jcr.codebelt.net/geekle/globalization-docfx:$versionaligns well with the PR objectives.Consider adding a comment explaining the significance of this Docker image, such as:
# Build Docker image for Codebelt.Extensions.Globalization documentationThis would provide context for future maintainers about the purpose of this image.
src/Codebelt.Extensions.Globalization/CultureInfoSurrogate.cs (2)
5-7: Consider initializing properties in the parameterless constructor.The empty constructor leaves the
DateTimeFormatandNumberFormatproperties uninitialized. Consider either:
- Initializing these properties with default values in this constructor, or
- Documenting the reason for leaving them uninitialized if it's intentional.
This will help prevent potential null reference exceptions and clarify the expected state of the object after using this constructor.
9-13: Add unit tests for the parameterized constructor.The static analysis tool indicates that the parameterized constructor (lines 9-13) is not covered by tests. To ensure proper initialization and prevent potential regressions, it's important to add unit tests for this constructor.
Consider adding tests that:
- Verify that the properties are correctly set when the constructor is called with valid parameters.
- Ensure that appropriate exceptions are thrown if null values are passed (after implementing the null checks suggested earlier).
This will improve the overall reliability and maintainability of the code.
Would you like me to provide a sample unit test for this constructor?
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 9-13: src/Codebelt.Extensions.Globalization/CultureInfoSurrogate.cs#L9-L13
Added lines #L9 - L13 were not covered by tests.docfx/packages/index.md (1)
3-4: LGTM! Consider adding version information.The introductory text has been successfully updated to reflect the rebranding to Codebelt. The link to NuGet.org with the specific query is helpful for users.
Consider adding information about the current version (8.4.0) mentioned in the PR objectives. This could help users quickly identify the latest release. For example:
-This is a list of all NuGet packages from **Extensions for Globalization API by Codebelt** that is publicly available on [NuGet.org](https://www.nuget.org/packages?q=Codebelt.Extensions); the packages here are listed alphabetically and are available in preview-, rc- and production-ready versions. +This is a list of all NuGet packages from **Extensions for Globalization API by Codebelt** (current version 8.4.0) that is publicly available on [NuGet.org](https://www.nuget.org/packages?q=Codebelt.Extensions); the packages here are listed alphabetically and are available in preview-, rc- and production-ready versions.Directory.Build.targets (1)
17-19: Approved: Good adaptation for GitHub Actions, consider adding a commentThe change from
$(BUILD_BUILDNUMBER)to$(GITHUB_RUN_ID)is a good adaptation for using GitHub Actions in the CI/CD pipeline. This aligns well with the project's restructuring objectives.Consider adding a comment explaining the use of
GITHUB_RUN_IDand the fallback mechanism. This would improve maintainability. For example:+ <!-- Use GITHUB_RUN_ID if available (for GitHub Actions), otherwise default to 00000 --> <BUILD_BUILDNUMBER Condition="'$(GITHUB_RUN_ID)' == ''">00000</BUILD_BUILDNUMBER> + <BUILD_BUILDNUMBER Condition="'$(GITHUB_RUN_ID)' != ''">$(GITHUB_RUN_ID)</BUILD_BUILDNUMBER> <FileVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BUILD_BUILDNUMBER)</FileVersion>This change also explicitly sets
BUILD_BUILDNUMBERtoGITHUB_RUN_IDwhen it's available, which might be beneficial for clarity..docfx/api/namespaces/Codebelt.Extensions.Globalization.md (3)
7-9: LGTM: Good inclusion of availability and complementary namespace information.The availability notice and the link to the
System.Globalizationnamespace documentation are helpful additions.Consider adding a brief description of what "availability-default" means for clarity, if it's not explained in the included file.
11-15: LGTM: Extension methods table is clear and concise.The table effectively lists the new
UseNationalLanguageSupportmethod for theCultureInfotype.Consider adding a legend or explanation for the downward arrow (⬇️) in the "Ext" column to improve clarity for readers.
17-25: LGTM: C# example effectively demonstrates the new functionality.The example clearly shows the difference in
ShortDatePatternoutput between a standardCultureInfoinstance and one using the newUseNationalLanguageSupportmethod.Consider adding a brief explanation of why the patterns differ and the benefits of using national language support. This would provide more context for users and highlight the value of the new method.
.nuget/Codebelt.Extensions.Globalization/README.md (3)
1-5: LGTM! Consider adding a badge for the MIT license.The About section effectively introduces the project, its purpose, and licensing. It's concise and informative, which is ideal for a README file.
Consider adding an MIT license badge at the beginning of the README for quick visual reference. You can use a service like shields.io to generate the badge. For example:
[](https://opensource.org/licenses/MIT)
9-13: LGTM! Consider improving the link formatting.The description and documentation link provide valuable information for users.
To improve readability, consider formatting the documentation link as follows:
More documentation is available at our [documentation site](https://globalization.codebelt.net/api/Codebelt.Extensions.Globalization.html).This inline link style is more common in markdown and may be easier for readers to follow.
15-23: LGTM! Consider enhancing the code example formatting.The C# example effectively demonstrates the key functionality of the library, showing the difference between ICU and NLS date formatting.
To improve the code example:
- Use a single code block with proper language specification:
### C# Example ```csharp var danishCultureIcu = new CultureInfo("da-dk", false); var danishCultureNls = new CultureInfo("da-dk", false).UseNationalLanguageSupport(); // Output: dd.MM.yyyy Console.WriteLine(danishCultureIcu.DateTimeFormat.ShortDatePattern); // Output: dd-MM-yyyy Console.WriteLine(danishCultureNls.DateTimeFormat.ShortDatePattern);2. Add actual `Console.WriteLine` statements to make the example more concrete and easier to understand. These changes will improve syntax highlighting and make the example more clear and executable. </blockquote></details> <details> <summary>CHANGELOG.md (2)</summary><blockquote> `21-29`: **LGTM with suggestion: Version 8.0.0 changes are well-documented, but could be more detailed.** The changelog entry for version 8.0.0 clearly describes the addition of the new tool for extracting NLS surrogates. However, the update to National Language Support (NLS) surrogates could benefit from more detail. Consider adding information about the nature or extent of these updates to provide more context for users. <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary><blockquote> [uncategorized] ~29-~29: The verb “was” doesn’t seem to fit in this context, “were” is probably more formally correct. Context: ...ional Language Support (NLS) surrogates was updated in the Codebelt.Extensions.Glob... (AI_HYDRA_LEO_CPT_WAS_WERE) </blockquote></details> </details> --- Line range hint `1-6`: **LGTM with suggestion: Overall structure of CHANGELOG.md is excellent.** The CHANGELOG.md file follows the Keep a Changelog format and adheres to Semantic Versioning. The structure is consistent across versions, with clear categorization of changes. Consider adding links to the `PackageReleaseNotes.txt` files mentioned in the introduction. This would make it easier for users to access more detailed release notes for specific assemblies. <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary><blockquote> [grammar] ~5-~5: In this context, “per-assembly” forms an adjective and is spelled with a hyphen. Context: ...refer to `PackageReleaseNotes.txt` on a per assembly basis in the `.nuget` folder. ## [8.... (PER_USER_BASIS_HYPHEN) --- [uncategorized] ~29-~29: The verb “was” doesn’t seem to fit in this context, “were” is probably more formally correct. Context: ...ional Language Support (NLS) surrogates was updated in the Codebelt.Extensions.Glob... (AI_HYDRA_LEO_CPT_WAS_WERE) </blockquote></details> </details> </blockquote></details> <details> <summary>src/Codebelt.Extensions.Globalization/DateTimeFormatInfoSurrogate.cs (2)</summary><blockquote> `12-31`: **Add unit tests for the parameterized constructor.** The parameterized constructor (lines 12-31) is not covered by unit tests. To ensure reliability and catch potential regressions, it's important to add test coverage for this constructor. Would you like me to generate a unit test for the parameterized constructor or create a GitHub issue to track this task? <details> <summary>🧰 Tools</summary> <details> <summary>🪛 GitHub Check: codecov/patch</summary><blockquote> [warning] 12-31: src/Codebelt.Extensions.Globalization/DateTimeFormatInfoSurrogate.cs#L12-L31 Added lines #L12 - L31 were not covered by tests </blockquote></details> </details> --- `33-65`: **Add XML documentation to key properties.** Consider adding XML documentation to key properties to improve code clarity and maintainability. This is especially important for properties that might not be self-explanatory, such as `CalendarWeekRule` or `MonthDayPattern`. Example: ```csharp /// <summary> /// Gets or sets the calendar week rule. /// </summary> public CalendarWeekRule CalendarWeekRule { get; set; }.github/workflows/pipelines.yml (1)
29-29: Excellent addition of multiple framework versions.The inclusion of net8.0, net6.0, and netstandard2.0 in the build matrix is a great improvement. This ensures broader compatibility and aligns well with the project's objectives.
Consider adding a comment explaining the rationale behind supporting these specific versions, which can be helpful for future maintainers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (265)
src/Codebelt.Extensions.Globalization/Surrogates/aa-dj.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/aa-er.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/aa-et.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/af-na.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/af-za.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/agq-cm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ak-gh.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/am-et.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-001.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-ae.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-bh.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-dj.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-dz.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-eg.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-er.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-il.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-iq.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-jo.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-km.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-kw.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-lb.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-ly.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-ma.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-mr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-om.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-ps.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-qa.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-sa.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-sd.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-so.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-ss.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-sy.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-td.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-tn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ar-ye.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/arn-cl.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/as-in.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/asa-tz.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ast-es.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/az-cyrl-az.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/az-latn-az.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ba-ru.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bas-cm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/be-by.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bem-zm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bez-tz.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bg-bg.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bin-ng.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bm-latn-ml.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bn-bd.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bn-in.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bo-cn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bo-in.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/br-fr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/brx-in.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bs-cyrl-ba.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/bs-latn-ba.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/byn-er.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ca-ad.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ca-es.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ca-fr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ca-it.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ccp-cakm-bd.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ccp-cakm-in.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ce-ru.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ceb-latn-ph.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/cgg-ug.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/chr-cher-us.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/co-fr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/cs-cz.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/cu-ru.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/cy-gb.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/da-dk.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/da-gl.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/dav-ke.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/de-at.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/de-be.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/de-ch.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/de-de.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/de-it.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/de-li.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/de-lu.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/dje-ne.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/doi-deva-in.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/dsb-de.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/dua-cm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/dv-mv.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/dyo-sn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/dz-bt.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ebu-ke.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ee-gh.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ee-tg.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/el-cy.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/el-gr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-001.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-029.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-150.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ae.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ag.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ai.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-as.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-at.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-au.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-bb.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-be.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-bi.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-bm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-bs.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-bw.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-bz.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ca.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-cc.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ch.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ck.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-cm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-cx.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-cy.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-de.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-dk.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-dm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-er.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-fi.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-fj.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-fk.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-fm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-gb.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-gd.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-gg.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-gh.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-gi.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-gm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-gu.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-gy.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-hk.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-id.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ie.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-il.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-im.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-in.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-io.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-je.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-jm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ke.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ki.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-kn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ky.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-lc.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-lr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ls.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-mg.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-mh.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-mo.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-mp.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ms.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-mt.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-mu.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-mw.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-my.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-na.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-nf.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ng.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-nl.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-nr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-nu.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-nz.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-pg.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ph.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-pk.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-pn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-pr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-pw.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-rw.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-sb.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-sc.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-sd.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-se.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-sg.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-sh.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-si.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-sl.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ss.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-sx.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-sz.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-tc.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-tk.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-to.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-tt.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-tv.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-tz.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ug.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-um.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-us.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-vc.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-vg.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-vi.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-vu.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-ws.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-za.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-zm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/en-zw.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/eo-001.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-419.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-ar.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-bo.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-br.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-bz.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-cl.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-co.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-cr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-cu.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-do.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-ec.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-es.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-gq.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-gt.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-hn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-mx.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-ni.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-pa.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-pe.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-ph.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-pr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-py.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-sv.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-us.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-uy.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/es-ve.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/et-ee.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/eu-es.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ewo-cm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fa-af.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fa-ir.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-bf.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-cm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-gh.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-gm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-gn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-gw.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-lr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-mr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-ne.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-ng.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-sl.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-adlm-sn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-bf.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-cm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-gh.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-gm.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-gn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-gw.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-lr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-mr.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-ne.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-ng.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-sl.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/ff-latn-sn.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fi-fi.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fil-ph.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fo-dk.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fo-fo.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fr-029.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fr-be.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fr-bf.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fr-bi.binis excluded by!**/*.binsrc/Codebelt.Extensions.Globalization/Surrogates/fr-bj.binis excluded by!**/*.bin
📒 Files selected for processing (29)
- .docfx/BuildDocfxImage.ps1 (1 hunks)
- .docfx/Dockerfile.docfx (1 hunks)
- .docfx/PublishDocfxImage.ps1 (1 hunks)
- .docfx/api/namespaces/ClassLibrary1.md (0 hunks)
- .docfx/api/namespaces/Codebelt.Extensions.Globalization.md (1 hunks)
- .docfx/docfx.json (2 hunks)
- .docfx/index.md (1 hunks)
- .docfx/packages/index.md (1 hunks)
- .docfx/toc.yml (1 hunks)
- .github/workflows/pipelines.yml (5 hunks)
- .gitignore (1 hunks)
- .nuget/ClassLibrary1/PackageReleaseNotes.txt (0 hunks)
- .nuget/ClassLibrary1/README.md (0 hunks)
- .nuget/Codebelt.Extensions.Globalization/PackageReleaseNotes.txt (1 hunks)
- .nuget/Codebelt.Extensions.Globalization/README.md (1 hunks)
- CHANGELOG.md (1 hunks)
- ClassLibrary1.sln (0 hunks)
- Codebelt.Extensions.Globalization.sln (1 hunks)
- Directory.Build.props (5 hunks)
- Directory.Build.targets (1 hunks)
- README.md (1 hunks)
- src/ClassLibrary1/Class1.cs (0 hunks)
- src/ClassLibrary1/ClassLibrary1.csproj (0 hunks)
- src/Codebelt.Extensions.Globalization/Codebelt.Extensions.Globalization.csproj (1 hunks)
- src/Codebelt.Extensions.Globalization/CultureInfoExtensions.cs (1 hunks)
- src/Codebelt.Extensions.Globalization/CultureInfoSurrogate.cs (1 hunks)
- src/Codebelt.Extensions.Globalization/DateTimeFormatInfoSurrogate.cs (1 hunks)
- src/Codebelt.Extensions.Globalization/NumberFormatInfoSurrogate.cs (1 hunks)
- src/Codebelt.Extensions.Globalization/Properties/AssemblyInfo.cs (1 hunks)
💤 Files with no reviewable changes (6)
- .docfx/api/namespaces/ClassLibrary1.md
- .nuget/ClassLibrary1/PackageReleaseNotes.txt
- .nuget/ClassLibrary1/README.md
- ClassLibrary1.sln
- src/ClassLibrary1/Class1.cs
- src/ClassLibrary1/ClassLibrary1.csproj
✅ Files skipped from review due to trivial changes (1)
- Codebelt.Extensions.Globalization.sln
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md
[uncategorized] ~29-~29: The verb “was” doesn’t seem to fit in this context, “were” is probably more formally correct.
Context: ...ional Language Support (NLS) surrogates was updated in the Codebelt.Extensions.Glob...(AI_HYDRA_LEO_CPT_WAS_WERE)
README.md
[style] ~15-~15: Using many exclamation marks might seem excessive (in this case: 7 exclamation marks for a text that’s 1838 characters long)
Context: ....Extensions.Globalization?logo=nuget) | 
🪛 Markdownlint
README.md
9-9: Expected: h2; Actual: h3
Heading levels should only increment by one level at a time(MD001, heading-increment)
🪛 GitHub Check: codecov/patch
src/Codebelt.Extensions.Globalization/CultureInfoExtensions.cs
[warning] 71-76: src/Codebelt.Extensions.Globalization/CultureInfoExtensions.cs#L71-L76
Added lines #L71 - L76 were not covered by testssrc/Codebelt.Extensions.Globalization/CultureInfoSurrogate.cs
[warning] 9-13: src/Codebelt.Extensions.Globalization/CultureInfoSurrogate.cs#L9-L13
Added lines #L9 - L13 were not covered by testssrc/Codebelt.Extensions.Globalization/DateTimeFormatInfoSurrogate.cs
[warning] 12-31: src/Codebelt.Extensions.Globalization/DateTimeFormatInfoSurrogate.cs#L12-L31
Added lines #L12 - L31 were not covered by testssrc/Codebelt.Extensions.Globalization/NumberFormatInfoSurrogate.cs
[warning] 11-36: src/Codebelt.Extensions.Globalization/NumberFormatInfoSurrogate.cs#L11-L36
Added lines #L11 - L36 were not covered by tests
🔇 Additional comments (56)
.docfx/PublishDocfxImage.ps1 (1)
1-3: Overall, the changes look good and align with the PR objectives.The modifications to this script accurately reflect the project's rebranding from "ClassLibrary1" to "Codebelt.Extensions.Globalization" and the transition to a new Docker repository. The use of a private Docker registry (jcr.codebelt.net) is a positive security practice.
To further improve the script:
- Consider using environment variables for the repository URL and image name to enhance flexibility and maintainability.
- Ensure that all necessary documentation is updated to reflect these changes in the Docker image handling process.
.docfx/Dockerfile.docfx (1)
1-1: Approved: Nginx base image update looks good.The update of the Nginx base image from version 1.27.0 to 1.27.1 is a positive change. Minor version updates often include important bug fixes and security patches, which can improve the stability and security of your documentation serving environment.
To ensure this update doesn't introduce any unexpected issues, consider the following:
- Review the Nginx 1.27.1 changelog to understand the specific changes and their potential impact on your setup.
- Verify that the documentation builds and serves correctly with this new base image.
- Check if there are any known issues or incompatibilities with other components in your stack.
You can use the following script to check the Nginx version and configuration after building the image:
This script will help verify that the new Nginx version is correctly installed and that the configuration is as expected.
src/Codebelt.Extensions.Globalization/Properties/AssemblyInfo.cs (4)
5-5: LGTM! ComVisible set to false enhances security.Setting
ComVisible(false)is a good practice. It prevents the types in this assembly from being automatically exposed to COM, which enhances security by reducing the attack surface. This is appropriate unless COM interop is specifically required for this assembly.
1-6: Overall, the AssemblyInfo.cs file looks good and follows best practices.The file contains the necessary assembly-level attributes:
InternalsVisibleTofor controlled internal accessComVisible(false)for enhanced securityGuidfor unique assembly identificationThese attributes are correctly formatted and contain appropriate values. The file structure aligns with standard practices for AssemblyInfo.cs files in .NET projects.
6-6: LGTM! Verify the uniqueness of the assembly GUID.The
Guidattribute assigns a unique identifier to the assembly, which is correct. This is particularly important for COM interop scenarios.To ensure the uniqueness of this GUID across your codebase, you can run the following command:
#!/bin/bash # Search for duplicate GUIDs in the codebase rg --type cs "312a337a-ae79-4da1-bd4c-fddd19804e91"If this command returns only this file, then the GUID is unique within your codebase.
4-4: LGTM! Verify the public key for the "gse" assembly.The use of
InternalsVisibleTois appropriate for allowing access to internal members from a specific assembly, which is common in testing scenarios or for tightly coupled assemblies. This maintains encapsulation while enabling necessary access.Please ensure that the public key provided matches the actual public key of the "gse" assembly. You can verify this by running the following command in the directory containing the "gse" assembly:
Compare the output with the last 16 characters of the public key in the
InternalsVisibleToattribute.src/Codebelt.Extensions.Globalization/CultureInfoSurrogate.cs (1)
3-4: LGTM: Class declaration is appropriate.The
CultureInfoSurrogateclass is correctly declared asinternal, which is suitable for a surrogate class that should only be used within the assembly. The class name clearly indicates its purpose in relation toCultureInfo..docfx/index.md (5)
1-4: LGTM: Metadata updated correctly.The title has been appropriately updated to reflect the project's new identity as "Extensions for Globalization by Codebelt". This change aligns well with the rebranding effort mentioned in the PR objectives.
7-10: LGTM: Clear and informative introduction.The title and introduction effectively communicate the project's new identity and provide valuable context about its origins. The explanation for the split from Cuemon, mentioning .NET 9 and circular reference dependencies, aligns well with the PR objectives.
13-13: LGTM: Appropriate reference to the original project.The inclusion of a link to the original Cuemon for .NET project and the explanation of its continued purpose provide valuable context for users. This helps maintain a clear relationship between the two projects while emphasizing their separation.
15-15: LGTM: Effective call to action for further exploration.The call to action effectively directs users to the detailed API documentation, encouraging them to explore the project's capabilities further.
Please verify that the documentation link is correct and leads to the appropriate page:
#!/bin/bash # Description: Verify the existence of the API documentation file. # Test: Check if the API documentation file exists if fd -p "api/Codebelt.Extensions.Globalization.html" > /dev/null; then echo "API documentation file found." else echo "API documentation file not found. Please ensure it's generated and placed in the correct location." fi
11-13: LGTM: Project information updated correctly.The project information has been updated to reflect its new identity as "Extensions for Globalization API by Codebelt". The inclusion of the GitHub repository link is valuable for users.
Please verify that the GitHub repository link is correct and accessible:
#!/bin/bash # Description: Verify the GitHub repository link. # Test: Check if the GitHub repository exists and is accessible if gh repo view codebeltnet/globalization &> /dev/null; then echo "GitHub repository is accessible." else echo "Unable to access the GitHub repository. Please verify the link." fi.docfx/packages/index.md (3)
11-11: LGTM! Package table updated correctly.The table entry has been successfully updated to reflect the new package name "Codebelt.Extensions.Globalization". The inclusion of links to the NuGet package and badges for vNext, Stable, and Downloads provides valuable information for users.
1-11: Overall, good job on updating the documentation!The changes in this file successfully reflect the rebranding from ClassLibrary1 to Codebelt.Extensions.Globalization. The updated content aligns well with the PR objectives, providing clear information about the new package structure and availability on NuGet.
To further improve the documentation:
- Consider adding the current version number (8.4.0) to the introductory text.
- Ensure the package description accurately reflects the focus on globalization rather than RESTful versioning.
- Verify that the change in section header level (from ## to ###) aligns with the intended document structure.
These minor adjustments will enhance the clarity and consistency of the documentation.
5-7:⚠️ Potential issueVerify header level and update package description.
The section header has been changed from level 2 (##) to level 3 (###). Ensure this aligns with the intended document structure.
The package description mentions "a focused API for RESTful versioning", which seems inconsistent with the globalization focus mentioned in the PR objectives.
Consider updating the description to better reflect the globalization focus. For example:
-Provides a focused API for RESTful versioning. +Provides extensions to enhance the functionality of the System.Globalization namespace..docfx/api/namespaces/Codebelt.Extensions.Globalization.md (1)
1-5: LGTM: Namespace declaration and summary are clear and accurate.The namespace declaration and summary effectively communicate the purpose of
Codebelt.Extensions.Globalizationas an extension to theSystem.Globalizationnamespace..nuget/Codebelt.Extensions.Globalization/README.md (2)
7-8: LGTM! Clear and informative title.The project title is well-formatted and provides essential information about the project name and its target platform (.NET).
1-23: Overall, the README.md provides a solid introduction to the project.The README.md file effectively introduces the Codebelt.Extensions.Globalization project, covering its purpose, licensing, and key functionality. The suggested improvements will enhance its readability and user-friendliness. Consider implementing the proposed changes to make the README even more informative and visually appealing.
CHANGELOG.md (3)
7-11: LGTM: Version 8.4.0 changes are well-documented.The changelog entry for version 8.4.0 clearly describes the transition from
Cuemon.Extensions.YamlDotNettoCodebelt.Extensions.YamlDotNetfor theCultureInfoExtensionsclass. This is consistent with the project's migration objectives.
13-19: LGTM: Version 8.3.0 changes are well-documented.The changelog entry for version 8.3.0 clearly describes the transition from legacy YAML support in
Cuemon.CoretoCuemon.Extensions.YamlDotNetfor multiple components. This change is consistent acrossCultureInfoExtensions,CultureInfoSurrogate, and thetooling/gse.
31-35: LGTM: Version 7.0.0 changes are well-documented.The changelog entry for version 7.0.0 clearly describes the addition of the
CultureInfoExtensionsclass with theUseNationalLanguageSupportmethod. This is appropriately documented as a major version change..docfx/docfx.json (5)
47-47: LGTM: Application title updated to reflect new project focus.The change from "Shared Kernel (DDD) for .NET" to "Extensions for Globalization by Codebelt" accurately represents the project's new focus on Globalization extensions. This update improves clarity in the generated documentation.
51-51: LGTM: Google Analytics Tag ID updated.The Google Analytics Tag ID has been updated from a placeholder value to "G-R07CSX4Z91", which appears to be a valid Google Analytics 4 measurement ID.
Please ensure that this new Tag ID is correctly set up in your Google Analytics account to properly track the documentation site usage.
Line range hint
1-89: Overall changes look good and align with project rebranding.The updates to the DocFX configuration file consistently reflect the project's rebranding from ClassLibrary1 to Codebelt.Extensions.Globalization. These changes are crucial for generating accurate documentation for the rebranded project. The modifications to project paths, metadata, and external references all contribute to the successful migration from Cuemon to Codebelt.
55-55: LGTM: Git repository URL updated correctly.The change from "https://github.com/classlibrary1/ClassLibrary1" to "https://github.com/codebeltnet/globalization" accurately reflects the new project repository. This update is essential for proper source linking and contribution guidelines in the generated documentation.
Let's verify the existence and accessibility of the new repository:
#!/bin/bash # Description: Verify the existence and accessibility of the new GitHub repository # Test: Check if the repository exists and is accessible gh repo view codebeltnet/globalization --json name,description,url
7-7: LGTM: Project file path updated correctly.The change from "ClassLibrary1/.csproj" to "Codebelt.Extensions.Globalization/.csproj" accurately reflects the project rebranding. This update is essential for DocFX to process the correct project files.
Let's verify the consistency of this change across the codebase:
✅ Verification successful
Let's address the issues by running corrected verification scripts:
Let’s refine the verification scripts to ensure we accurately locate the new
.csprojfile and confirm the absence of any references to the old project name:
Verified: Project file names updated correctly and no references to the old project name found.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the project file name change across the codebase # Test 1: Check if the new .csproj file exists fd -e csproj -d 2 'Codebelt.Extensions.Globalization.csproj' # Test 2: Ensure no references to the old project name remain rg -i 'classlibrary1' -g '!.docfx/docfx.json'Length of output: 479
Script:
# Description: Verify the project file name change across the codebase # Test 1: Check if the new .csproj file exists fd -e csproj -d 2 'Codebelt.Extensions.Globalization.csproj' # Test 2: Ensure no references to the old project name remain rg -i 'classlibrary1' -g '!.docfx/docfx.json'Length of output: 106
Script:
# Description: Verify the project file name change across the codebase # Test 1: Check for any new .csproj files matching the new naming convention fd -e csproj 'Codebelt.Extensions.Globalization*' # Test 2: Ensure no references to the old project name remain, case-insensitive rg -i 'classlibrary1' --glob '!.docfx/docfx.json'Length of output: 272
.nuget/Codebelt.Extensions.Globalization/PackageReleaseNotes.txt (7)
16-22: Consistent changes in version 8.3.0 as part of migration processThe changes in version 8.3.0 show a consistent transition from Cuemon.Core to Cuemon.Extensions.YamlDotNet across multiple components (CultureInfoExtensions, CultureInfoSurrogate, and tooling/gse). This appears to be an intermediate step in the migration process from Cuemon to Codebelt, laying the groundwork for the final transition in version 8.4.0.
24-28: Approved: Routine dependency updates in version 8.2.0The update of dependencies to their latest versions is a good practice for maintaining the project's security and performance.
30-40: Approved: Consistent dependency updates in versions 8.1.0 and 8.0.1Both versions 8.1.0 and 8.0.1 maintain the good practice of updating dependencies to their latest versions, ensuring the project remains current and secure.
1-52: Summary: Release notes align well with PR objectivesThe release notes effectively document the migration process from Cuemon to Codebelt, as well as other significant improvements to the library. Key points:
- The gradual transition from Cuemon to Codebelt is clearly visible across versions.
- Breaking changes are properly highlighted and versioned.
- Consistent updates to dependencies and supported .NET versions are maintained.
- New features like the globalization surrogates extractor (gse) have been added to improve functionality.
These changes align well with the PR objectives of migrating the library and improving its structure and functionality.
1-8: Approved: Version 8.4.0 changes align with migration objectives.The changes in this version, particularly the switch from Cuemon.Extensions.YamlDotNet to Codebelt.Extensions.YamlDotNet, align well with the PR objectives of migrating from Cuemon to Codebelt. The version number increase to 8.4.0 is justified due to the breaking change.
To ensure that all references to Cuemon.Extensions.YamlDotNet have been replaced, run the following script:
#!/bin/bash # Description: Check for any remaining references to Cuemon.Extensions.YamlDotNet # Test: Search for Cuemon.Extensions.YamlDotNet in all files. Expect: No results. rg --type-not binary "Cuemon\.Extensions\.YamlDotNet"
42-52: Approved: Significant improvements in version 8.0.0Version 8.0.0 introduces important changes:
- Support for .NET 8 has been added, keeping the library up-to-date with the latest .NET version.
- The addition of tooling/gse (globalization surrogates extractor) is a notable improvement. It addresses a previous design decision and enhances the library's functionality for handling NLS surrogates.
These changes demonstrate a commitment to maintaining and improving the library's capabilities.
To ensure that .NET 8 support has been properly added, run the following script:
#!/bin/bash # Description: Verify .NET 8 support in project files # Test: Search for net8.0 in all .csproj files. Expect: At least one result. rg --type csproj "net8\.0"
10-14: Note: Removal of .NET 7 support in version 8.3.2The removal of support for .NET 7 (STS) is a significant change that may impact users who are still using this version. While this change doesn't directly relate to the migration from Cuemon to Codebelt, it's an important update that should be communicated clearly to users.
To ensure that all references to .NET 7 have been removed from the project files, run the following script:
✅ Verification successful
Action Required: Re-verify Removal of .NET 7 References
Please run the following updated script to check for any remaining references to .NET 7 in
.csprojfiles:
Verification Successful: .NET 7 Support Removed
All references to .NET 7 (STS) have been successfully removed from the project files, ensuring compatibility with .NET 8, .NET 6, and .NET Standard 2.0.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining references to .NET 7 in project files # Test: Search for net7.0 in all .csproj files. Expect: No results. rg --type csproj "net7\.0"Length of output: 227
Script:
# Description: Check for any remaining references to .NET 7 in project files # Test: Search for net7.0 in all .csproj files. Expect: No results. rg "net7\.0" --glob "*.csproj"Length of output: 32
README.md (4)
1-5: LGTM: Project title and badges updated successfully.The changes to the project title and the addition of badges align well with the rebranding effort and provide valuable project health information.
7-7: LGTM: Clear and concise project description added.The new project description effectively communicates the purpose and focus of the library, aligning well with the rebranding and restructuring objectives.
9-16: LGTM: Package information updated correctly.The standalone packages section has been successfully updated to reflect the new package name "Codebelt.Extensions.Globalization". The table structure provides clear information about the package versions and downloads.
Note: The static analysis tool flagged excessive exclamation marks in line 15, but this can be safely ignored as these are part of the markdown syntax for images used in the badges.
🧰 Tools
🪛 LanguageTool
[style] ~15-~15: Using many exclamation marks might seem excessive (in this case: 7 exclamation marks for a text that’s 1838 characters long)
Context: ....Extensions.Globalization?logo=nuget) | 
🪛 Markdownlint
9-9: Expected: h2; Actual: h3
Heading levels should only increment by one level at a time(MD001, heading-increment)
Line range hint
22-23: LGTM: License information added correctly.The addition of the license section is crucial for open-source projects. It clearly states the project is under the MIT License and provides a link to the full license text.
🧰 Tools
🪛 LanguageTool
[style] ~15-~15: Using many exclamation marks might seem excessive (in this case: 7 exclamation marks for a text that’s 1838 characters long)
Context: ....Extensions.Globalization?logo=nuget) | 
[style] ~19-~19: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...UTING.md) are welcome and appreciated. Feel free to submit issues, feature requests, or pul...(FEEL_FREE_TO_STYLE_ME)
🪛 Markdownlint
9-9: Expected: h2; Actual: h3
Heading levels should only increment by one level at a time(MD001, heading-increment)
src/Codebelt.Extensions.Globalization/DateTimeFormatInfoSurrogate.cs (2)
1-7: LGTM: Namespace and class declaration are well-structured.The namespace
Codebelt.Extensions.Globalizationaligns with the project structure, and the internalDateTimeFormatInfoSurrogateclass is appropriately named and scoped.
8-31: LGTM: Constructors are well-implemented.Both constructors are correctly implemented. The parameterized constructor properly initializes all properties from the input
DateTimeFormatInfo.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 12-31: src/Codebelt.Extensions.Globalization/DateTimeFormatInfoSurrogate.cs#L12-L31
Added lines #L12 - L31 were not covered by testssrc/Codebelt.Extensions.Globalization/NumberFormatInfoSurrogate.cs (3)
1-6: LGTM: Namespace and class declaration are appropriate.The namespace
Codebelt.Extensions.Globalizationaligns with the project's new structure. The internal classNumberFormatInfoSurrogateis appropriately named and scoped for its purpose as a surrogate forNumberFormatInfo.
7-36: LGTM: Constructors are well-implemented.Both constructors are appropriately implemented. The parameterized constructor correctly initializes all properties from the input
NumberFormatInfo, which is crucial for creating a surrogate object.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 11-36: src/Codebelt.Extensions.Globalization/NumberFormatInfoSurrogate.cs#L11-L36
Added lines #L11 - L36 were not covered by tests
38-82: LGTM: Properties are correctly defined.The properties accurately mirror those found in the
System.Globalization.NumberFormatInfoclass, which is essential for the surrogate's functionality..github/workflows/pipelines.yml (5)
1-1: LGTM: Workflow name and trigger updates are appropriate.The workflow name change to "Globalization Ext. CI/CD Pipeline" accurately reflects the project's new focus. Adding '**.md' to the paths-ignore is a good practice to prevent unnecessary builds for documentation changes.
Also applies to: 9-9
48-53: LGTM: Signing key references updated correctly.The renaming of the signing key download step and updating the object name from "classlibrary1.snk" to "globalization.snk" are consistent with the project's rebranding efforts.
138-138: LGTM: SonarCloud project key updated appropriately.The SonarCloud project key has been correctly updated to "globalization", which aligns with the project's new name and ensures proper association of code quality metrics.
Line range hint
1-165: Overall, the CI/CD pipeline changes are well-implemented and consistent.The updates to the
.github/workflows/pipelines.ymlfile successfully reflect the project's transition from "ClassLibrary1" to "Codebelt.Extensions.Globalization". Key improvements include:
- Updated workflow name and trigger conditions
- Expanded framework support in the build matrix
- Consistent renaming of artifacts and project references
- Updated integration with external services (SonarCloud, CodeCov)
These changes ensure that the CI/CD pipeline aligns with the new project structure and branding while maintaining comprehensive quality checks and deployments.
165-165: Repository reference updated correctly for CodeCov.The CodeCov repository reference has been appropriately updated to "codebeltnet/globalization", which aligns with the new organization and repository name.
To ensure all repository references have been updated consistently, please run the following verification script:
✅ Verification successful
Repository references have been verified successfully.
All references to the old repository
organization/classlibrary1have been removed and correctly updated tocodebeltnet/globalization.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all repository references have been updated consistently # Test: Search for any remaining references to the old repository name rg --type yaml 'organization/classlibrary1' # Test: Confirm all references use the new repository name rg --type yaml 'codebeltnet/globalization'Length of output: 384
Script:
#!/bin/bash # Description: Re-verify all repository references by searching all files without restricting to YAML. # Test: Search for any remaining references to the old repository name rg 'organization/classlibrary1' # Test: Confirm all references use the new repository name rg 'codebeltnet/globalization'Length of output: 1331
.gitignore (2)
377-380: Overall assessment: Changes to .gitignore are appropriate.The additions to the .gitignore file align with the project's migration and restructuring objectives. They improve security by excluding sensitive files (SNK) and potentially reduce clutter from tool-generated content. These changes support a cleaner repository structure, which is beneficial for the project's new direction.
379-380: Approved: Ignoring/tooling/gse/Surrogatesdirectory.Adding the
/tooling/gse/Surrogatesdirectory to .gitignore is likely appropriate if it contains generated files or tool-specific temporary data.To ensure this doesn't exclude important files from version control, please clarify:
- What is the purpose of the
/tooling/gse/Surrogatesdirectory?- Does it contain any configuration files or scripts that should be tracked?
#!/bin/bash # Check if the directory exists and list its contents if [ -d "/tooling/gse/Surrogates" ]; then echo "Contents of /tooling/gse/Surrogates:" ls -R /tooling/gse/Surrogates else echo "The /tooling/gse/Surrogates directory does not exist in the current state of the repository." fi # Check if there's any documentation about this directory grep -r "tooling/gse/Surrogates" . --include="*.md" --include="*.txt"src/Codebelt.Extensions.Globalization/Codebelt.Extensions.Globalization.csproj (3)
1-10: Project properties are well-defined and appropriate.The project properties are correctly set up:
- The project GUID ensures uniqueness.
- The description clearly explains the purpose of the library.
- The package tags are relevant and will help with discoverability.
These properties align well with the project's focus on globalization extensions for .NET.
1202-1205: Verify the use of Cuemon.Extensions.Reflection package.The project references two packages:
- Codebelt.Extensions.YamlDotNet (version 8.4.0)
- Cuemon.Extensions.Reflection (version 8.3.2)
While the Codebelt package aligns with the project's namespace, the Cuemon package stands out.
Could you confirm if the use of Cuemon.Extensions.Reflection is intentional? Given the migration process mentioned in the PR objectives, it might be worth considering:
- If there's an equivalent Codebelt package that could replace Cuemon.Extensions.Reflection.
- If not, whether there are plans to migrate this dependency in the future.
If the Cuemon package is still required, it might be helpful to add a comment explaining why it's being used to provide context for future maintenance.
1-1207: Overall, the project file is well-structured and appropriate for its purpose.The Codebelt.Extensions.Globalization.csproj file is correctly set up as a .NET project for a globalization extension library. It includes:
- Clear project properties
- A comprehensive set of embedded resources for various languages and cultures
- Relevant package references
The main suggestions for improvement are:
- Optimizing the embedded resources section to reduce duplication
- Clarifying the use of the Cuemon.Extensions.Reflection package
These changes could enhance the maintainability of the project file. Otherwise, the structure and content align well with the project's globalization focus.
Directory.Build.props (3)
18-18: Verify Compatibility with Added Target FrameworksThe
TargetFrameworksproperty now includesnet8.0;net6.0;netstandard2.0. Ensure that the codebase and all dependencies are compatible with these frameworks, especiallynetstandard2.0, which may require some API adjustments.
56-56: Ensure Compatibility with .NET Framework 4.8The test project for Windows includes
net48in theTargetFrameworks. Ensure that the test code and all dependencies are compatible with .NET Framework 4.8.
84-84: Verify Availability of 'Codebelt.Extensions.Xunit' Version '8.4.1'Ensure that the package
Codebelt.Extensions.Xunitversion8.4.1is available in the NuGet repository and accessible during the build process.Here is a script to check if the package is referenced correctly:
#!/bin/bash # Description: Verify that 'Codebelt.Extensions.Xunit' version '8.4.1' is referenced in the project files. # Expected result: List of project files referencing the package with the specified version. # Search for package references in project files fd '\.csproj$' --exec rg '<PackageReference Include="Codebelt\.Extensions\.Xunit" Version="8\.4\.1"' {}src/Codebelt.Extensions.Globalization/CultureInfoExtensions.cs (1)
71-76: Lines not covered by unit testsStatic analysis indicates that lines 71-76 are not covered by tests. This is the code block handling the case when
culture.IsReadOnlyistrue.Please consider adding unit tests to cover this scenario to ensure the cloning and enriching of read-only cultures work as expected.
Would you like assistance in creating unit tests for this code path or in opening a GitHub issue to track this task?
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 71-76: src/Codebelt.Extensions.Globalization/CultureInfoExtensions.cs#L71-L76
Added lines #L71 - L76 were not covered by tests
| - name: Globalization API | ||
| href: api/Codebelt.Extensions.Globalization.html |
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.
💡 Codebase verification
The new API documentation file api/Codebelt.Extensions.Globalization.html is missing. Please add the updated documentation to ensure consistency with the rebranding effort.
api/Codebelt.Extensions.Globalization.html
🔗 Analysis chain
LGTM! The TOC changes align with the rebranding effort.
The updates to the table of contents accurately reflect the migration from "ClassLibrary1" to "Codebelt.Extensions.Globalization". This change is consistent with the PR objectives and the overall rebranding effort.
To ensure consistency across the documentation, let's verify that all references to the old name have been updated:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any remaining references to ClassLibrary1 in documentation files
# Test: Search for "ClassLibrary1" in all documentation files
# Expect: No occurrences of "ClassLibrary1" in .md, .html, or .yml files
rg --type md --type html --type yaml "ClassLibrary1" .
# Test: Verify that the new API documentation file exists
# Expect: File should exist
test -f "api/Codebelt.Extensions.Globalization.html" && echo "New API doc exists" || echo "New API doc missing"
Length of output: 156
| $version = minver -i -t v -v w | ||
| docfx metadata docfx.json | ||
| docker buildx build -t yourbranding/classlibrary1:$version --platform linux/arm64,linux/amd64 --load -f Dockerfile.docfx . | ||
| docker buildx build -t jcr.codebelt.net/geekle/globalization-docfx:$version --platform linux/arm64,linux/amd64 --load -f Dockerfile.docfx . | ||
| get-childItem -recurse -path api -include *.yml, .manifest | remove-item |
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.
🛠️ Refactor suggestion
Consider adding error handling and logging to the script.
While the script covers all necessary steps for building and tagging the Docker image, it could benefit from some additional robustness:
- Error handling: Add checks after each critical operation to ensure they completed successfully.
- Logging: Include logging statements to track the progress of the script and aid in troubleshooting.
Here's an example of how you could enhance the script:
# Function for logging
function Log-Message {
param([string]$message)
Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - $message"
}
try {
Log-Message "Starting build process"
$version = minver -i -t v -v w
if (-not $version) { throw "Failed to generate version number" }
Log-Message "Generated version: $version"
docfx metadata docfx.json
if ($LASTEXITCODE -ne 0) { throw "docfx metadata generation failed" }
Log-Message "Metadata generated successfully"
docker buildx build -t jcr.codebelt.net/geekle/globalization-docfx:$version --platform linux/arm64,linux/amd64 --load -f Dockerfile.docfx .
if ($LASTEXITCODE -ne 0) { throw "Docker build failed" }
Log-Message "Docker image built successfully"
get-childItem -recurse -path api -include *.yml, .manifest | remove-item
Log-Message "Cleanup completed"
Log-Message "Build process completed successfully"
} catch {
Log-Message "Error: $_"
exit 1
}This enhanced version includes error checking, logging, and a try-catch block to handle any unexpected errors.
| internal CultureInfoSurrogate(DateTimeFormatInfoSurrogate dateTimeFormat, NumberFormatInfoSurrogate numberFormat) | ||
| { | ||
| DateTimeFormat = dateTimeFormat; | ||
| NumberFormat = numberFormat; | ||
| } |
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.
Add null checks for constructor parameters.
While the constructor correctly initializes both properties, it's advisable to add null checks for the parameters to prevent potential issues with null references later in the code.
Consider adding null checks like this:
internal CultureInfoSurrogate(DateTimeFormatInfoSurrogate dateTimeFormat, NumberFormatInfoSurrogate numberFormat)
{
DateTimeFormat = dateTimeFormat ?? throw new ArgumentNullException(nameof(dateTimeFormat));
NumberFormat = numberFormat ?? throw new ArgumentNullException(nameof(numberFormat));
}This ensures that the object is always in a valid state after construction.
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 9-13: src/Codebelt.Extensions.Globalization/CultureInfoSurrogate.cs#L9-L13
Added lines #L9 - L13 were not covered by tests
| internal DateTimeFormatInfoSurrogate DateTimeFormat { get; set; } | ||
|
|
||
| internal NumberFormatInfoSurrogate NumberFormat { get; set; } |
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.
🛠️ Refactor suggestion
Consider making properties read-only or document the need for setters.
The DateTimeFormat and NumberFormat properties currently have both getters and setters. This allows them to be changed after the object is initialized, which could lead to unexpected behavior if not carefully managed.
Consider one of the following options:
- Make the properties read-only by removing the setters if they're not intended to be changed after initialization:
internal DateTimeFormatInfoSurrogate DateTimeFormat { get; } internal NumberFormatInfoSurrogate NumberFormat { get; }
- If setters are necessary, document the reason and any potential side effects of changing these properties after initialization.
This will help prevent unintended modifications and make the class's behavior more predictable.
| title: Extensions for Globalization by Codebelt | ||
| --- | ||
| # ClassLibrary1 | ||
|  |
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.
💡 Codebase verification
Issue: Image file not found
The specified image images/128x128.png does not exist in the repository. Please ensure the image is added to the correct directory or update the path in the .docfx/index.md file accordingly.
🔗 Analysis chain
LGTM: Image added for visual representation.
The addition of an image enhances the visual appeal of the documentation. This is a good improvement.
Please verify that the image file exists at the specified path:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the existence of the project logo image.
# Test: Check if the image file exists
if fd -p "images/128x128.png" > /dev/null; then
echo "Image file found."
else
echo "Image file not found. Please ensure it's placed in the correct location."
fi
Length of output: 119
Script:
#!/bin/bash
# Description: Verify the existence of the project logo image.
# Test: Check if the image file exists using fd
fd "128x128.png" ./images --type f --max-depth 1 > /dev/null
if [ $? -eq 0 ]; then
echo "Image file found."
else
echo "Image file not found. Please ensure it's placed in the correct location."
fi
Length of output: 320
Script:
#!/bin/bash
# Description: Check for the 'images' directory and locate '128x128.png' if necessary.
# Check if the 'images' directory exists
if [ -d "./images" ]; then
echo "Directory './images' exists."
# Check if the image file exists within the 'images' directory
if [ -f "./images/128x128.png" ]; then
echo "Image file '128x128.png' found in './images/'."
else
echo "Image file '128x128.png' not found in './images/'."
fi
else
echo "Directory './images' does not exist. Searching for '128x128.png' in the repository."
# Search for the image file in the repository
image_path=$(fd "128x128.png" . --type f --max-depth 10)
if [ -n "$image_path" ]; then
echo "Image file found at: $image_path"
else
echo "Image file '128x128.png' not found in the repository."
fi
fi
Length of output: 407
| /// </summary> | ||
| public static class CultureInfoExtensions | ||
| { | ||
| private static readonly List<CultureInfo> EnrichedCultureInfos = new(); |
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.
Thread safety concerns with 'EnrichedCultureInfos'
The static list EnrichedCultureInfos is being accessed and modified by the UseNationalLanguageSupport methods. If these methods are called concurrently from multiple threads, it could lead to race conditions and data corruption.
Consider using a thread-safe collection like ConcurrentDictionary or implementing proper synchronization to ensure thread safety when accessing and modifying EnrichedCultureInfos.
| public static CultureInfo UseNationalLanguageSupport(this CultureInfo culture) | ||
| { | ||
| Validator.ThrowIfNull(culture); | ||
| return UseNationalLanguageSupport(Arguments.ToEnumerableOf(culture)).SingleOrDefault(); |
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.
Ensure 'SingleOrDefault()' returns a valid result
In the UseNationalLanguageSupport method, you return the result of SingleOrDefault():
return UseNationalLanguageSupport(Arguments.ToEnumerableOf(culture)).SingleOrDefault();If the UseNationalLanguageSupport method returns an empty collection, SingleOrDefault() will return null, which might lead to unexpected NullReferenceException in the calling code.
Consider adding a null check or providing a default value to handle this possibility.
| /// <param name="culture">The of <see cref="CultureInfo"/> to extend.</param> | ||
| /// <returns>A <see cref="CultureInfo"/> object enriched with the original Windows variant.</returns> | ||
| /// <exception cref="ArgumentNullException"> | ||
| /// <paramref name="culture"/> is null. | ||
| /// </exception> | ||
| /// <remarks>Replaces the value on the public writable properties of <see cref="CultureInfo.DateTimeFormat"/> and <see cref="CultureInfo.NumberFormat"/> to favor NLS (https://learn.microsoft.com/en-us/windows/win32/intl/national-language-support) instead of ICU (http://site.icu-project.org/home).</remarks> | ||
| public static CultureInfo UseNationalLanguageSupport(this CultureInfo culture) | ||
| { | ||
| Validator.ThrowIfNull(culture); | ||
| return UseNationalLanguageSupport(Arguments.ToEnumerableOf(culture)).SingleOrDefault(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Enriches the specified <paramref name="cultures"/> with the original Windows variant. | ||
| /// </summary> | ||
| /// <param name="cultures">The sequence of <see cref="CultureInfo"/> to extend.</param> | ||
| /// <returns>A sequence of <see cref="CultureInfo"/> objects enriched with the original Windows variant.</returns> | ||
| /// <exception cref="ArgumentNullException"> | ||
| /// <paramref name="cultures"/> is null. | ||
| /// </exception> | ||
| /// <remarks>Replaces the value on the public writable properties of <see cref="CultureInfo.DateTimeFormat"/> and <see cref="CultureInfo.NumberFormat"/> to favor NLS (https://learn.microsoft.com/en-us/windows/win32/intl/national-language-support) instead of ICU (http://site.icu-project.org/home).</remarks> | ||
| public static IEnumerable<CultureInfo> UseNationalLanguageSupport(this IEnumerable<CultureInfo> cultures) | ||
| { | ||
| Validator.ThrowIfNull(cultures); | ||
|
|
||
| var enrichedCultures = new List<CultureInfo>(); | ||
| foreach (var culture in cultures) | ||
| { | ||
| var enrichedCulture = EnrichedCultureInfos.Find(ci => ci.Name.Equals(culture.Name, StringComparison.Ordinal)); | ||
| if (enrichedCulture != null) | ||
| { | ||
| enrichedCultures.Add(enrichedCulture); | ||
| } | ||
| else | ||
| { | ||
| var surrogate = typeof(CultureInfoExtensions).GetEmbeddedResources($"{culture.Name}.bin", ManifestResourceMatch.ContainsName).SingleOrDefault(); | ||
| var ms = new MemoryStream(surrogate.Value.DecompressGZip().ToByteArray()); | ||
| var surrogateCulture = YamlFormatter.DeserializeObject<CultureInfoSurrogate>(ms, o => | ||
| { | ||
| o.Settings.NamingConvention = NullNamingConvention.Instance; | ||
| o.Settings.ReflectionRules = new MemberReflection(); | ||
| o.Settings.IndentSequences = false; | ||
| }); | ||
|
|
||
| if (culture.IsReadOnly) | ||
| { | ||
| var cultureClone = culture.Clone() as CultureInfo; | ||
| Enrich(cultureClone, surrogateCulture); | ||
| EnrichedCultureInfos.Add(cultureClone); | ||
| enrichedCultures.Add(cultureClone); | ||
| } | ||
| else | ||
| { | ||
| Enrich(culture, surrogateCulture); | ||
| EnrichedCultureInfos.Add(culture); | ||
| enrichedCultures.Add(culture); | ||
| } | ||
| } | ||
| } | ||
| return enrichedCultures; | ||
| } | ||
|
|
||
| private static void Enrich(CultureInfo culture, CultureInfoSurrogate surrogate) | ||
| { | ||
| culture.DateTimeFormat.AMDesignator = surrogate.DateTimeFormat.AMDesignator; | ||
| culture.DateTimeFormat.CalendarWeekRule = surrogate.DateTimeFormat.CalendarWeekRule; | ||
| culture.DateTimeFormat.DateSeparator = surrogate.DateTimeFormat.DateSeparator; | ||
| culture.DateTimeFormat.FirstDayOfWeek = surrogate.DateTimeFormat.FirstDayOfWeek; | ||
| culture.DateTimeFormat.FullDateTimePattern = surrogate.DateTimeFormat.FullDateTimePattern; | ||
| culture.DateTimeFormat.LongDatePattern = surrogate.DateTimeFormat.LongDatePattern; | ||
| culture.DateTimeFormat.MonthDayPattern = surrogate.DateTimeFormat.MonthDayPattern; | ||
| culture.DateTimeFormat.LongTimePattern = surrogate.DateTimeFormat.LongTimePattern; | ||
| culture.DateTimeFormat.PMDesignator = surrogate.DateTimeFormat.PMDesignator; | ||
| culture.DateTimeFormat.ShortDatePattern = surrogate.DateTimeFormat.ShortDatePattern; | ||
| culture.DateTimeFormat.ShortTimePattern = surrogate.DateTimeFormat.ShortTimePattern; | ||
| culture.DateTimeFormat.TimeSeparator = surrogate.DateTimeFormat.TimeSeparator; | ||
| culture.DateTimeFormat.YearMonthPattern = surrogate.DateTimeFormat.YearMonthPattern; | ||
| culture.DateTimeFormat.ShortestDayNames = surrogate.DateTimeFormat.ShortestDayNames; | ||
| culture.DateTimeFormat.AbbreviatedDayNames = surrogate.DateTimeFormat.AbbreviatedDayNames; | ||
| culture.DateTimeFormat.AbbreviatedMonthNames = surrogate.DateTimeFormat.AbbreviatedMonthNames; | ||
| culture.DateTimeFormat.AbbreviatedMonthGenitiveNames = surrogate.DateTimeFormat.AbbreviatedMonthGenitiveNames; | ||
|
|
||
| culture.NumberFormat.CurrencyDecimalDigits = surrogate.NumberFormat.CurrencyDecimalDigits; | ||
| culture.NumberFormat.CurrencyDecimalSeparator = surrogate.NumberFormat.CurrencyDecimalSeparator; | ||
| culture.NumberFormat.CurrencyGroupSeparator = surrogate.NumberFormat.CurrencyGroupSeparator; | ||
| culture.NumberFormat.CurrencyNegativePattern = surrogate.NumberFormat.CurrencyNegativePattern; | ||
| culture.NumberFormat.CurrencyPositivePattern = surrogate.NumberFormat.CurrencyPositivePattern; | ||
| culture.NumberFormat.CurrencySymbol = surrogate.NumberFormat.CurrencySymbol; | ||
| culture.NumberFormat.DigitSubstitution = surrogate.NumberFormat.DigitSubstitution; | ||
| culture.NumberFormat.NaNSymbol = surrogate.NumberFormat.NaNSymbol; | ||
| culture.NumberFormat.NegativeInfinitySymbol = surrogate.NumberFormat.NegativeInfinitySymbol; | ||
| culture.NumberFormat.NegativeSign = surrogate.NumberFormat.NegativeSign; | ||
| culture.NumberFormat.NumberDecimalDigits = surrogate.NumberFormat.NumberDecimalDigits; | ||
| culture.NumberFormat.NumberDecimalSeparator = surrogate.NumberFormat.NumberDecimalSeparator; | ||
| culture.NumberFormat.NumberGroupSeparator = surrogate.NumberFormat.NumberGroupSeparator; | ||
| culture.NumberFormat.NumberNegativePattern = surrogate.NumberFormat.NumberNegativePattern; | ||
| culture.NumberFormat.PerMilleSymbol = surrogate.NumberFormat.PerMilleSymbol; | ||
| culture.NumberFormat.PercentDecimalDigits = surrogate.NumberFormat.PercentDecimalDigits; | ||
| culture.NumberFormat.PercentDecimalSeparator = surrogate.NumberFormat.PercentDecimalSeparator; | ||
| culture.NumberFormat.PercentGroupSeparator = surrogate.NumberFormat.PercentGroupSeparator; | ||
| culture.NumberFormat.PercentNegativePattern = surrogate.NumberFormat.PercentNegativePattern; | ||
| culture.NumberFormat.PercentPositivePattern = surrogate.NumberFormat.PercentPositivePattern; | ||
| culture.NumberFormat.PercentSymbol = surrogate.NumberFormat.PercentSymbol; | ||
| culture.NumberFormat.PositiveInfinitySymbol = surrogate.NumberFormat.PositiveInfinitySymbol; | ||
| culture.NumberFormat.PositiveSign = surrogate.NumberFormat.PositiveSign; | ||
| } | ||
| } | ||
| } |
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.
🛠️ Refactor suggestion
Consider replacing manual property assignments with automatic mapping
In the Enrich method (lines 88-131), you're manually assigning many properties from the surrogate to the culture object. This approach can be error-prone and hard to maintain, especially if properties are added or removed in future updates.
Consider using reflection or a mapping library like AutoMapper to automate this process. Below is an example using reflection:
private static void Enrich(CultureInfo culture, CultureInfoSurrogate surrogate)
{
foreach (var property in typeof(DateTimeFormatInfo).GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
if (property.CanWrite)
{
var value = property.GetValue(surrogate.DateTimeFormat);
property.SetValue(culture.DateTimeFormat, value);
}
}
foreach (var property in typeof(NumberFormatInfo).GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
if (property.CanWrite)
{
var value = property.GetValue(surrogate.NumberFormat);
property.SetValue(culture.NumberFormat, value);
}
}
}This will make the code cleaner and easier to maintain.
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 71-76: src/Codebelt.Extensions.Globalization/CultureInfoExtensions.cs#L71-L76
Added lines #L71 - L76 were not covered by tests
| else | ||
| { | ||
| var surrogate = typeof(CultureInfoExtensions).GetEmbeddedResources($"{culture.Name}.bin", ManifestResourceMatch.ContainsName).SingleOrDefault(); | ||
| var ms = new MemoryStream(surrogate.Value.DecompressGZip().ToByteArray()); |
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.
🛠️ Refactor suggestion
Optimize memory usage when processing the surrogate
Currently, you decompress the surrogate and convert it to a byte array before creating a MemoryStream:
var ms = new MemoryStream(surrogate.Value.DecompressGZip().ToByteArray());This approach can be memory-intensive. Consider using streams to process the decompressed data without loading the entire content into memory at once.
Modify the code to work with streams directly:
using var decompressedStream = surrogate.Value.DecompressGZip();
var ms = new MemoryStream();
decompressedStream.CopyTo(ms);
ms.Position = 0;This change can improve memory efficiency by avoiding the intermediate byte array.
| /// <summary> | ||
| /// Enriches the specified <paramref name="culture"/> with the original Windows variant. | ||
| /// </summary> | ||
| /// <param name="culture">The of <see cref="CultureInfo"/> to extend.</param> |
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.
Typographical error in XML documentation
In the XML comment for the culture parameter, there is a typo:
- Original: "The of
<see cref="CultureInfo"/>to extend." - Corrected: "The
<see cref="CultureInfo"/>to extend."
Apply this diff to fix the typo:
-/// <param name="culture">The of <see cref="CultureInfo"/> to extend.</param>
+/// <param name="culture">The <see cref="CultureInfo"/> to extend.</param>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| /// <param name="culture">The of <see cref="CultureInfo"/> to extend.</param> | |
| /// <param name="culture">The <see cref="CultureInfo"/> to extend.</param> |



PR Classification
Migration of
Cuemon.Extensions.GlobalizationtoCodebelt.Extensions.Globalization.PR Summary
The project has been rebranded and restructured, with updates to documentation, build scripts, and configuration files to align with the new project name and structure.
globalization,The decision to move Globalization extensions out of Cuemon for .NET is to avoid what resembled circular reference dependencies and to provide faster updates with a tighter focus.
Summary by CodeRabbit
Release Notes
New Features
Codebelt.Extensions.Globalizationnamespace with extension methods for enhancingSystem.Globalization.UseNationalLanguageSupportmethod forCultureInfoto prioritize National Language Support (NLS).CultureInfoSurrogate,DateTimeFormatInfoSurrogate, andNumberFormatInfoSurrogate.Changes
Bug Fixes