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

Ensure correct dependency code-generation ordering #27

Merged
merged 2 commits into from
Jan 20, 2024
Merged

Conversation

dfed
Copy link
Owner

@dfed dfed commented Jan 20, 2024

Our attempt to use .sorted(...) to sort dependencies in #26 was ill-fated, as this method (reasonably!) stops sorting when neighbors are sorted rather then when all members are sorted relative to one another.

The general concept of ordering dependencies based on dependency order was correct however. In this PR, we utilize insertion sort on a linked list to create the proper sort order.

@dfed dfed self-assigned this Jan 20, 2024
@dfed dfed force-pushed the dfed--dependency-sort branch from 030a10e to 32ebe59 Compare January 20, 2024 07:27
Copy link

codecov bot commented Jan 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a2d9db4) 99.36% compared to head (830ceb9) 99.40%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   99.36%   99.40%   +0.03%     
==========================================
  Files          40       42       +2     
  Lines        8888     9147     +259     
==========================================
+ Hits         8832     9093     +261     
+ Misses         56       54       -2     
Files Coverage Δ
...afeDICore/Generators/DependencyTreeGenerator.swift 97.29% <100.00%> (-0.02%) ⬇️
Sources/SafeDICore/Generators/ScopeGenerator.swift 100.00% <100.00%> (+0.46%) ⬆️
Sources/SafeDICore/Models/List.swift 100.00% <100.00%> (ø)
Tests/SafeDICoreTests/ListTests.swift 100.00% <100.00%> (ø)
...DICoreTests/UnorderedEquatingCollectionTests.swift 100.00% <100.00%> (+3.33%) ⬆️
Tests/SafeDIToolTests/SafeDIToolTests.swift 100.00% <100.00%> (ø)

@dfed dfed force-pushed the dfed--dependency-sort branch from a9f94a7 to 830ceb9 Compare January 20, 2024 07:50
@dfed dfed requested a review from MrAdamBoyd January 20, 2024 07:52
@dfed dfed marked this pull request as ready for review January 20, 2024 07:52
@dfed dfed merged commit f530029 into main Jan 20, 2024
10 checks passed
@dfed dfed deleted the dfed--dependency-sort branch January 20, 2024 08:03
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