feat: Use yaml-rust2 to get line numbers for better errors
This commit is contained in:
parent
e67a427dc3
commit
1481fba40a
14 changed files with 930 additions and 221 deletions
|
|
@ -21,6 +21,10 @@ pub trait FromFileList {
|
|||
const LIST_KEY: &str;
|
||||
|
||||
fn get_from_file_paths(&self) -> Vec<PathBuf>;
|
||||
|
||||
fn get_module_from_file_paths(&self) -> Vec<PathBuf> {
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn base_recipe_path() -> &'static Path {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,18 @@ impl FromFileList for StagesExt<'_> {
|
|||
.filter_map(Stage::get_from_file_path)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn get_module_from_file_paths(&self) -> Vec<PathBuf> {
|
||||
self.stages
|
||||
.iter()
|
||||
.flat_map(|stage| {
|
||||
stage
|
||||
.required_fields
|
||||
.as_ref()
|
||||
.map_or_else(Vec::new, |rf| rf.modules_ext.get_from_file_paths())
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&PathBuf> for StagesExt<'_> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue