-
Notifications
You must be signed in to change notification settings - Fork 4
refactor: Configuration.resolve as a regular constructor #50
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
Configuration.resolve was a factory constructor, preventing its invocation from subclass constructors. This makes it a regular constructor.
📝 WalkthroughWalkthroughThe update refactors the argument parsing logic in the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Configuration
participant ArgParser
Caller->>Configuration: new Configuration.resolve(options, args, ...)
alt argResults not provided and args provided
Configuration->>Configuration: _prepareArgResults(args)
Configuration->>ArgParser: parse(args)
ArgParser-->>Configuration: ArgResults or FormatException
alt FormatException
Configuration->>Caller: throw error
end
end
Configuration->>Configuration: resolve options
alt errors found
Configuration->>Caller: throw error
else
Configuration-->>Caller: Configuration instance
end
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learningslib/src/config/configuration.dart (1)⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (3)
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 (
|
exaby73
left a comment
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.
LGTM. This change does introduce a bit of duplicated code, but I think it's fine as it's reads better than to further extract to be pedantically DRY
Configuration.resolve was a factory constructor, preventing its invocation from subclass constructors. This makes it a regular constructor.
Summary by CodeRabbit