Skip to content

Update copyright notices and improve code quality #12

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 1 commit into from
Apr 13, 2025

Conversation

BenjaminAbt
Copy link
Member

This pull request includes several changes to update copyright notices and improve code consistency across multiple files.

Copyright updates:

  • Updated copyright notices to include the URL https://myCSharp.de instead of myCSharp.de in various files:
    • .editorconfig
    • samples/HttpClientHints.Samples.AspNetCoreMvc/Controllers/HomeController.cs
    • samples/HttpClientHints.Samples.AspNetCoreMvc/Program.cs
    • src/HttpClientHints.AspNetCore/HttpClientHintsHttpContextExtensions.cs
    • src/HttpClientHints.AspNetCore/HttpClientHintsMiddlewareConfig.cs
    • src/HttpClientHints.AspNetCore/HttpClientHintsOptions.cs
    • src/HttpClientHints.AspNetCore/HttpClientHintsRegistration.cs
    • src/HttpClientHints.AspNetCore/HttpClientHintsRequestMiddleware.cs
    • src/HttpClientHints/HttpClientHints.cs
    • src/HttpClientHints/HttpClientHintsInterpreter.cs
    • tests/HttpClientHints.AspNetCore.UnitTests/HttpClientHintsHttpContextExtensionsTests.cs
    • tests/HttpClientHints.AspNetCore.UnitTests/HttpClientHintsRegistrationTests.cs
    • tests/HttpClientHints.AspNetCore.UnitTests/HttpClientHintsRequestMiddlewareTests.cs
    • tests/HttpClientHints.UnitTests/HttpClientHintsInterpreterTests.cs

Code consistency improvements:

  • Improved type consistency in HttpClientHintsHttpContextExtensions.cs:
    • Changed the type of cached to object? in GetClientHints method
    • Explicitly declared newHints as HttpClientHints in GetClientHints method
  • Simplified object initialization in unit tests:
    • Used target-typed new expressions for HeaderDictionary initialization in HttpClientHintsHttpContextExtensionsTests.cs [1] [2] [3]

This commit updates copyright comments across multiple files to include a complete URL for the copyright holder. It also enhances type safety and readability by changing variable types and using nullable reference types. The indentation size in the `.editorconfig` file has been changed from 4 to 2, affecting code formatting. Additionally, test files have been updated to use shorthand syntax for initializing `HeaderDictionary`. These changes aim to improve code quality, consistency, and adherence to modern C# practices.
@BenjaminAbt BenjaminAbt merged commit 03fc546 into main Apr 13, 2025
2 checks passed
@BenjaminAbt BenjaminAbt deleted the feature/code-cleanup-6 branch April 13, 2025 11:20
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