Skip to content

add refactor for structure and overhead files #67

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

Merged
merged 2 commits into from
Apr 12, 2025

Conversation

BenjaminAbt
Copy link
Member

This pull request includes various updates to the .editorconfig file to improve code style consistency and enforce better coding practices. Additionally, there is a modification to the GitHub Actions workflow file to support multiple .NET SDKs.

Code Style and Configuration Updates:

  • .editorconfig: Added new sections for PowerShell, Shell, .NET project files, and updated indentation and line-ending settings for different file types. [1] [2]
  • .editorconfig: Changed severity levels for several dotnet_style rules from silent to suggestion to encourage better coding practices.
  • .editorconfig: Removed redundant naming rules and symbol specifications to streamline the configuration file. [1] [2]

GitHub Actions Workflow Update:

  • .github/workflows/ci.yml: Updated the workflow to use dotnet-nuget-build-multi-sdk.yml and added support for multiple .NET SDK versions (8.0.x, 9.0.x, 10.0.x).

- Implement tests for HttpUserAgentInformationExtensions to validate user agent type detection (browser, robot, unknown).
- Create tests for HttpUserAgentInformation to ensure correct parsing and creation for browsers, robots, and unknown agents.
- Add tests for HttpUserAgentPlatformInformation and HttpUserAgentPlatformType to verify constructor behavior and value mappings.
- Develop comprehensive tests for HttpUserAgentParser to check various user agent strings across different browsers and bots.
- Introduce caching provider tests for HttpUserAgentParserCachedProvider to confirm caching behavior and duplicate handling.
- Implement default provider tests for HttpUserAgentParserDefaultProvider to ensure consistent parsing results.
- Updated `LibraryComparisonBenchmarks.cs` to use a record type for `TestData`, enhancing readability and modernizing the code structure.
- Added summary comments in `HttpUserAgentParserMemoryCacheServiceCollectionExtensions.cs` and improved method documentation for clarity.
- Streamlined constructor initialization in `HttpUserAgentParserMemoryCachedProviderOptions.cs`, removing unnecessary keywords while preserving functionality.
@BenjaminAbt BenjaminAbt marked this pull request as ready for review April 12, 2025 10:45
@BenjaminAbt BenjaminAbt requested a review from Copilot April 12, 2025 10:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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

Files not reviewed (8)
  • .editorconfig: Language not supported
  • Directory.Build.props: Language not supported
  • Directory.Packages.props: Language not supported
  • MyCSharp.HttpUserAgentParser.sln: Language not supported
  • global.json: Language not supported
  • perf/HttpUserAgentParser.Benchmarks/HttpUserAgentParser.Benchmarks.csproj: Language not supported
  • src/HttpUserAgentParser.AspNetCore/HttpUserAgentParser.AspNetCore.csproj: Language not supported
  • src/HttpUserAgentParser.MemoryCache/HttpUserAgentParser.MemoryCache.csproj: Language not supported
Comments suppressed due to low confidence (1)

src/HttpUserAgentParser.MemoryCache/DependencyInjection/HttpUserAgentParserMemoryCacheServiceCollectionExtensions.cs:15

  • [nitpick] Inconsistent naming observed: the comment refers to 'HttpUserAgentParserCachedProvider' while the method and types use 'MemoryCached'. Consider standardizing the naming (either use 'Cache' or 'Cached') to improve clarity.
/// Registers <see cref="HttpUserAgentParserCachedProvider"/> as singleton to <see cref="IHttpUserAgentParserProvider"/>

@BenjaminAbt BenjaminAbt merged commit 239f343 into main Apr 12, 2025
2 checks passed
@BenjaminAbt BenjaminAbt deleted the feature/overhead-files branch April 12, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant