Skip to content
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

fix: #9 Fix warnings #12

Merged
merged 26 commits into from
Jul 24, 2024
Merged

fix: #9 Fix warnings #12

merged 26 commits into from
Jul 24, 2024

Conversation

miquelbeltran
Copy link
Contributor

@miquelbeltran miquelbeltran commented Jul 16, 2024

fix: #9 Fix warnings

Description 📝

  • Purpose: Fixes several warnings in the project
  • Approach: Enable some checks and perform the suggested fixes by the IDE in most cases.

Type of change

  • Fix

Updates

  • Enables "nullable" in projects (this leads to 100+ warnings appearing)
  • Applied suggestions regarding nullability.
  • Apply suggestions in other warnings (documentation, naming, etc.)

Screenshots 📷

  • None

Test plan 🧪

  • Project builds.
  • dotnet test passes.

Author to check 👓

  • Project and all contained modules builds successfully
  • Self-/dev-tested
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

Reviewer to check ✔️

  • Project and all contained modules builds successfully
  • Change has been dev-/reviewer-tested, where possible
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

@miquelbeltran miquelbeltran changed the base branch from main to code-formatting July 16, 2024 09:30
@miquelbeltran miquelbeltran changed the title fix: WIP Fix warnings fix: #9 Fix warnings Jul 16, 2024
@miquelbeltran miquelbeltran marked this pull request as ready for review July 16, 2024 09:31
This was referenced Jul 17, 2024
Copy link

@QuantumNightmare QuantumNightmare left a comment

Choose a reason for hiding this comment

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

Thanks for working towards this tidy up. One thing that stands out however is the change of acronyms to PascalCasing. e.g. OS -> Os and IL to Il etc.
I've previously heard that PascalCasing for these is the Microsoft recommendation, however we've stuck with all caps for acronyms throughout our .NET code and so would like to stick with that for consistency please. I also personally like the readability of all caps better in most cases.
You may want to add in a dotsettings rule to avoid them showing up as warnings.

@miquelbeltran miquelbeltran mentioned this pull request Jul 17, 2024
* ci: dotnet formatting

* simplify job

* test break formatting

* fix format

* dotnet format
Base automatically changed from code-formatting to 4-fix-tests July 17, 2024 04:54
Base automatically changed from 4-fix-tests to main July 17, 2024 05:22
@miquelbeltran
Copy link
Contributor Author

Hi @QuantumNightmare I have applied your suggestions and restored the acronyms name formatting.

@QuantumNightmare
Copy link

Hi @QuantumNightmare I have applied your suggestions and restored the acronyms name formatting.

Thanks, looks good 👍

Copy link

@QuantumNightmare QuantumNightmare left a comment

Choose a reason for hiding this comment

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

Looks good, just added some minor feedback

@@ -1,5 +1,8 @@
namespace Raygun.NetCore.Blazor.Server

Choose a reason for hiding this comment

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

I imagine we'll just want to delete this class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought the same, the Raygun.Blazor.Server question is addressed here: #22

private string? _calculatedBrowserVersion;
private string? _calculatedBrowserName;
private string? _calculatedOSVersion;
// private string? _browserManufacturer;

Choose a reason for hiding this comment

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

Should delete this unless we intend to wire it up

Copy link
Contributor

Choose a reason for hiding this comment

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

At one point I had intended to wire those up from the UserAgentHints, but then I discovered that the versioning at that level is a dictionary of multiple sets of values, including an extra key designed to throw off people doing things like this.

So I believe I decided to return the whole array (minus the BS extra key) instead, which means those can be deleted.

@@ -39,19 +39,19 @@ internal record EnvironmentDetails
/// The company who manufactured the browser.
/// </summary>
[JsonPropertyName("browser")]
public string BrowserManufacturer { get; set; }
public string? BrowserManufacturer { get; set; }

Choose a reason for hiding this comment

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

Outside the scope of this PR, but in case it gets missed later, the JsonPropertyName meaning something different to the property name may be unintentional here.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was intentional. I was looking for API consistency between what the browser returned, to help end users get a clear understanding of what the data point actually was. The JsonPropertyName just mapped that clarity I was trying to provide at the code level to the value the Raygun API was expecting in the payload.

@miquelbeltran miquelbeltran merged commit 08258d4 into main Jul 24, 2024
3 checks passed
@miquelbeltran miquelbeltran deleted the fix-warnings branch July 24, 2024 06:01
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.

All: Fix warnings
3 participants