feat: Use yaml-rust2 to get line numbers for better errors

This commit is contained in:
Gerald Pinder 2024-11-01 16:04:38 -04:00
parent e67a427dc3
commit 1481fba40a
14 changed files with 930 additions and 221 deletions

View file

@ -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 {

View file

@ -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<'_> {