-
Notifications
You must be signed in to change notification settings - Fork 240
Validate snfoundry.toml #3869
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: master
Are you sure you want to change the base?
Validate snfoundry.toml #3869
Conversation
… into 3811-fix-parsing-snfoundry-toml
| core::load_config( | ||
| raw_config_json, | ||
| profile.map_or_else(|| Profile::Default, |p| Profile::Some(p.to_string())), |
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.
This code was specifically refactored so that load_config can actually be shared between this top level function and forge which uses it directly.
If we cannot share logic between cast and forge at all, let's get rid of core::load_config entirely and use the primitives from core directly in forge logic.
| profile: Option<&str>, | ||
| ) -> Result<T> { | ||
| let config_path = path | ||
| pub fn load_config<T>(path: Option<&Utf8PathBuf>, profile: Option<&str>) -> Result<T> |
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.
Maybe rename this something it suggests more it's loading form snfoundry_toml?
| use std::env; | ||
|
|
||
| fn resolve_env_variables(config: serde_json::Value) -> anyhow::Result<serde_json::Value> { | ||
| pub fn resolve_env_variables(config: serde_json::Value) -> anyhow::Result<serde_json::Value> { |
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.
| pub fn resolve_env_variables(config: serde_json::Value) -> anyhow::Result<serde_json::Value> { | |
| pub(crate) fn resolve_env_variables(config: serde_json::Value) -> anyhow::Result<serde_json::Value> { |
If you need this in other modules pub is okay, but if it remains just for uses in this crate, let's not publish it.
Closes #3811
Introduced changes
Checklist
CHANGELOG.md