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

Generate Refit interfaces as partial #162

Merged
merged 5 commits into from
Sep 20, 2023
Merged

Conversation

christianhelle
Copy link
Owner

Generated interfaces across the codebase were changed from regular to partial. This change allows the clients to extend the functionality of these interfaces without modifying auto-generated code. Tests were also updated to verify this change

Generated interfaces across the codebase were changed from regular to partial. This change allows the clients to extend the functionality of these interfaces without modifying auto-generated code. Tests were also updated to verify this change
@christianhelle christianhelle added the enhancement New feature, bug fix, or request label Sep 20, 2023
@christianhelle christianhelle self-assigned this Sep 20, 2023
@christianhelle christianhelle linked an issue Sep 20, 2023 that may be closed by this pull request
Changed the interface declarations in the Refitter.Tests from regular to partial interfaces. This allows for more flexibility in implementation by allowing interfaces to be defined across multiple files, enhancing modularity and readability of the code.
Modified SwaggerPetstore and other related interfaces to being 'partial' in various source files. This allows for these interfaces to be defined in multiple parts for more flexible and manageable codebase extension.
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #162 (bf01689) into main (e05ae5d) will increase coverage by 0.00%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

❗ Current head bf01689 differs from pull request most recent head 193240d. Consider uploading reports for the commit 193240d to get more accurate results

@@           Coverage Diff           @@
##             main     #162   +/-   ##
=======================================
  Coverage   98.40%   98.41%           
=======================================
  Files          39       39           
  Lines        1255     1258    +3     
=======================================
+ Hits         1235     1238    +3     
  Misses          6        6           
  Partials       14       14           
Flag Coverage Δ
unittests 98.41% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/Refitter.Core/RefitInterfaceGenerator.cs 100.00% <100.00%> (ø)
...itter.Core/RefitMultipleInterfaceByTagGenerator.cs 93.33% <100.00%> (ø)
...c/Refitter.Core/RefitMultipleInterfaceGenerator.cs 97.95% <100.00%> (ø)
src/Refitter.Tests/SwaggerPetstoreTests.cs 99.33% <100.00%> (+0.01%) ⬆️

All interfaces were changed to partial in both README.md and Refitter/README.md of the SwaggerPetstore project. This allows for easy extension of these interfaces without modifying the generated code. Such a change prepares the code for upcoming features that may require the addition of methods to these interfaces. This is particularly important for maintaining backwards compatibility as the project grows.
Modified the PR template's example of a generated Refit interface. Specifically, the IReferenceparameters interface has been made partial. This change aligns the template with our coding standards that advise using partial interfaces for better modularity and maintenance.
@sonarcloud
Copy link

sonarcloud bot commented Sep 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@christianhelle christianhelle changed the title Generate partial interfaces Generate Refit interfaces as partial Sep 20, 2023
@christianhelle christianhelle merged commit 85f4c30 into main Sep 20, 2023
426 checks passed
@christianhelle christianhelle deleted the partial-interfaces branch September 20, 2023 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, bug fix, or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate Refit interfaces as partial by default
1 participant