INNER CODE UNIT · Rust

validate

stjude-rust-labs/sprocket · crates/sprocket-test-types/src/lib.rs:145

    pub fn validate(&self, associated_wdl: &Document) -> Result<(), Diagnostics> {
        let mut diagnostics = Diagnostics::default();

        for (target, definitions) in &self.targets {
            let target_callable = match associated_wdl.callable_by_name(&target.0.value) {
                Some(callable) => callable,
                None => {
                    diagnostics.add(
                        Diagnostic::error(format!(
                            "no target named `{name}` in `{path}`",
                            name = target.0.value,
                            path = associated_wdl.path()
                        ))
                        .with_highlight(convert_yaml_span(target.0.defined.span())),
                    );
                    continue;
                }
            };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…