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

Improve error messages when receiving a property that forms a cycle #95

Merged
merged 8 commits into from
Jul 7, 2024

Conversation

dfed
Copy link
Owner

@dfed dfed commented Jul 1, 2024

Resolves #93 and #94

@dfed dfed self-assigned this Jul 1, 2024
// MARK: - Set

extension Set {
fileprivate func removing(_ element: Element) -> Self {
Copy link
Owner Author

Choose a reason for hiding this comment

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

no longer used

Comment on lines 240 to 241
Dependency cycle detected on RootViewController!
authService: AuthService -> authService: AuthService
Copy link
Owner Author

Choose a reason for hiding this comment

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

honestly this is way, way better an error message

Comment on lines 404 to 405
Dependency cycle detected on RootViewController!
authService: AuthService -> authService: AuthService
Copy link
Owner Author

Choose a reason for hiding this comment

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

same here

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 99.54955% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.66%. Comparing base (0c3e958) to head (d3c28b2).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
- Coverage   99.66%   99.66%   -0.01%     
==========================================
  Files          47       47              
  Lines       11330    11520     +190     
==========================================
+ Hits        11292    11481     +189     
- Misses         38       39       +1     
Files Coverage Δ
...afeDICore/Generators/DependencyTreeGenerator.swift 97.43% <100.00%> (+0.32%) ⬆️
Sources/SafeDICore/Models/Dependency.swift 100.00% <100.00%> (ø)
Sources/SafeDICore/Models/Scope.swift 100.00% <100.00%> (ø)
...ToolTests/SafeDIToolCodeGenerationErrorTests.swift 99.88% <100.00%> (+0.01%) ⬆️
Sources/SafeDICore/Generators/ScopeGenerator.swift 99.66% <85.71%> (-0.34%) ⬇️

... and 2 files with indirect coverage changes

@dfed dfed changed the title Improve error message when receiving a property that forms a cycle Improve error messages when receiving a property that forms a cycle Jul 2, 2024
@dfed dfed marked this pull request as ready for review July 2, 2024 01:18
@dfed dfed linked an issue Jul 2, 2024 that may be closed by this pull request
@@ -80,68 +80,100 @@ final class Scope: Hashable {
propertyStack: OrderedSet<Property>,
erasedToConcreteExistential: Bool
) throws -> ScopeGenerator {
if
Copy link
Owner Author

Choose a reason for hiding this comment

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

Best reviewed with whitespace ignored.

The check in this if statement was moved (with changes) below under the comment // Check received children for cycles.

@dfed
Copy link
Owner Author

dfed commented Jul 7, 2024

Happy to take feedback post-merge!

@dfed dfed merged commit 13c4533 into main Jul 7, 2024
13 checks passed
@dfed dfed deleted the dfed--better-cycle-detection-error-message-94 branch July 7, 2024 18:09
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.

Improve error message when receiving a property that forms a cycle Enable receiving builders in a cycle
1 participant