-
Notifications
You must be signed in to change notification settings - Fork 0
Removed Algorithms dependency #7
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
Conversation
WalkthroughThe changes remove the dependency on the external "swift-algorithms" package from the project. All associated imports and references to the "Algorithms" module are eliminated. A new internal helper for computing Cartesian products is introduced in the test helpers. Dependency resolution files and the package manifest are updated accordingly. Changes
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
Tests/ProbeTestingTests/Suites/NestedEffectsTests.swift (1)
96-96: Updated to use custom product implementationThe function call has been correctly updated to use the new internal
productfunction instead of the one from the removed Algorithms package. The change is minimal and maintains the same behavior.However, there's a static analysis warning about magic numbers:
Consider replacing the magic numbers with named constants for better readability:
- arguments: product(1 ..< 3, 1 ..< 3), + arguments: product(minValue ..< maxValue, minValue ..< maxValue), 1 ..< 3With constants defined at the class level:
private let minValue = 1 private let maxValue = 3🧰 Tools
🪛 SwiftLint (0.57.0)
[Warning] 96-96: Magic numbers should be replaced by named constants
(no_magic_numbers)
[Warning] 96-96: Magic numbers should be replaced by named constants
(no_magic_numbers)
Tests/ProbeTestingTests/Helpers/Array+Product.swift (1)
9-18: Well-implemented Cartesian product replacementThis new helper function efficiently implements the Cartesian product functionality that was previously provided by the Algorithms package. Using
flatMapwithlazy.mapis an excellent approach for keeping the implementation efficient.Consider adding a brief documentation comment to explain what the function does:
+/** + * Returns an array containing ordered pairs of elements, one from each of the sequences. + * This is the Cartesian product of the two sequences. + */ internal func product<A, B>( _ first: some Sequence<A>, _ second: some Sequence<B> ) -> [(A, B)] {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (8)
Package.resolved(2 hunks)Package.swift(0 hunks)Sources/Probing/Errors/ProbingErrors.swift(1 hunks)Tests/ProbeTestingTests/Helpers/Array+Product.swift(1 hunks)Tests/ProbeTestingTests/Suites/EffectTests.swift(0 hunks)Tests/ProbeTestingTests/Suites/IndependentEffectsTests.swift(0 hunks)Tests/ProbeTestingTests/Suites/NestedEffectsTests.swift(1 hunks)Tests/ProbeTestingTests/Suites/ProbingOptionsTests.swift(0 hunks)
💤 Files with no reviewable changes (4)
- Tests/ProbeTestingTests/Suites/IndependentEffectsTests.swift
- Tests/ProbeTestingTests/Suites/EffectTests.swift
- Tests/ProbeTestingTests/Suites/ProbingOptionsTests.swift
- Package.swift
🧰 Additional context used
🧬 Code Graph Analysis (1)
Tests/ProbeTestingTests/Suites/NestedEffectsTests.swift (1)
Tests/ProbeTestingTests/Helpers/Array+Product.swift (1)
product(9-18)
🪛 SwiftLint (0.57.0)
Tests/ProbeTestingTests/Suites/NestedEffectsTests.swift
[Warning] 96-96: Magic numbers should be replaced by named constants
(no_magic_numbers)
[Warning] 96-96: Magic numbers should be replaced by named constants
(no_magic_numbers)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: build-and-test (watchos)
- GitHub Check: build-and-test (macos)
- GitHub Check: build-and-test (tvos)
- GitHub Check: build-and-test (ios)
- GitHub Check: build-and-test (maccatalyst)
🔇 Additional comments (2)
Package.resolved (1)
2-2: Dependency management updates properly reflect removed packagesThe
originHashupdate andPrincipleMacrosversion update from 1.0.4 to 1.0.6 are consistent with removing theswift-algorithmsandswift-numericsdependencies. This change aligns well with the PR objective.Also applies to: 18-19
Sources/Probing/Errors/ProbingErrors.swift (1)
218-218: Replaced Algorithms dependency with standard library approachThe code now uses the standard Swift
lazy.compactMap(\.self)approach instead of relying on a customcompacted()method from the Algorithms package. This change maintains the same functionality while removing the external dependency.
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
Summary by CodeRabbit