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

Re-use existing .refitter file if it already exists #909

Merged
merged 1 commit into from
May 21, 2024

Conversation

christianhelle
Copy link
Owner

PR Classification

This pull request ensures that the existing .refitter file is not overwritten when the user runs the refitter command. It also updates the serialization method to use System.Text.Json.JsonSerializer instead of JsonConvert.SerializeObject.

PR Summary

The pull request modifies the RefitterCodeGenerator.cs file to improve the handling of RefitGeneratorSettings and updates the serialization method.

  • RefitterCodeGenerator.cs: Updated using directives, added logic to check for a .refitter file before deserializing settings, and moved the serialization of settings to an else block.
  • RefitterCodeGenerator.cs: Switched from JsonConvert.SerializeObject to a new Serialize method for creating the DependencyContext.
  • RefitterCodeGenerator.cs: Added a new private Serialize method for serializing RefitGeneratorSettings with System.Text.Json.JsonSerializer.

@christianhelle christianhelle linked an issue May 20, 2024 that may be closed by this pull request
@christianhelle christianhelle self-assigned this May 20, 2024
@christianhelle christianhelle linked an issue May 20, 2024 that may be closed by this pull request
@christianhelle christianhelle added enhancement New feature or request .NET Pull requests that update .net code labels May 20, 2024
Copy link

sonarcloud bot commented May 20, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@christianhelle christianhelle merged commit f0822f5 into master May 21, 2024
90 of 91 checks passed
@christianhelle christianhelle deleted the fix-recreated-refitter-file branch May 21, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request .NET Pull requests that update .net code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refitter file gets overwritten Generated .refitter file formatting issue
1 participant