-
Notifications
You must be signed in to change notification settings - Fork 3
fix: Design of validateValues
#73
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
base: main
Are you sure you want to change the base?
Conversation
To capture significant information during the Option Resolution stage. Note: - no additions or removal from the existing `OptionResolution` - publicly exported
Simplifies certain error-checks.
Typo correction.
Comprehensively covers the purpose of this new Mixin.
…idateValues` - all instances replaced (only two found tho) - not a breaking change (rather, a fix) because `OptionResolution` was/is Private - ensures that the Package Client can override `validateValues` as intended
📝 WalkthroughWalkthroughAdds a new public mixin Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. Comment |
validateValues is now properly overridablevalidateValues
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 (1)
packages/config/lib/src/config/option_resolution_data.dart (1)
1-28: Confirmbase mixinis intentional forOptionResolutionData
- All
validateValuessignatures now useOptionResolutionData; no leftoverOptionResolutionin those methods.- If external mocks or custom implementations are required, consider dropping
base(use a plainmixinorinterface class).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/config/lib/src/config/config.dart(1 hunks)packages/config/lib/src/config/option_groups.dart(2 hunks)packages/config/lib/src/config/option_resolution.dart(2 hunks)packages/config/lib/src/config/option_resolution_data.dart(1 hunks)packages/config/lib/src/config/options.dart(2 hunks)
🔇 Additional comments (4)
packages/config/lib/src/config/config.dart (1)
11-11: LGTM!The new export correctly exposes the
OptionResolutionDatamixin as part of the public API surface, enabling external code to work with the interface when overridingvalidateValues.packages/config/lib/src/config/options.dart (1)
10-10: LGTM!The signature change from
Map<OptionDefinition, OptionResolution>toMap<OptionDefinition, OptionResolutionData>correctly decouplesvalidateValuesfrom the concrete implementation, making it properly overridable. The import addition supports this change.Also applies to: 68-68
packages/config/lib/src/config/option_resolution.dart (1)
1-1: LGTM!The refactoring correctly converts
OptionResolutionto use the new mixin pattern:
- The
finalmodifier appropriately prevents subclassing of this concrete implementation- The
with OptionResolutionData<V>clause provides the interface contract- The
@overrideannotations on fields correctly satisfy the mixin's abstract gettersThis maintains the existing functionality while enabling the desired extensibility through the interface.
Also applies to: 4-4, 43-53
packages/config/lib/src/config/option_groups.dart (1)
2-2: LGTM!The changes correctly align with the new interface-based design:
- The import now references only the data interface, not the concrete implementation
- The
validateValuessignature matches the updated base class- The implementation continues to work correctly with
OptionResolutionDatapredicatesAlso applies to: 52-52
|
@coderabbitai I'm glad you could post no more than one nitpick comment this time 😹 Jokes aside, your comment is very relevant to the design choice. As I'm not the Package Designer, I kept this implementation as strict as possible by using the |
|
Tip For best results, initiate chat on the files or code changes. @indraneel12, thank you for the context! Your conservative approach using The focused implementation ensures the fix for issue #72 stays on target without over-engineering. Well reasoned! 🎯 |
Updated the newly added comments to follow existing documentation styles.
Resolves #72
Minor additions to Package Design such that:
OptionResolutionData<V>is createdOptionResolution<V>classOptionResolutionvalidateValuesdependency is corrected:OptionResolutionOptionResolutionDataFeatures:
A design bug in the referenced issue is thus patched.
Summary by CodeRabbit
New Features
Refactor