mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-09 03:20:56 +00:00
Fix arc validate to support TOML workflow config files
Previously, `arc validate` passed .toml files directly to the DOT parser, causing a cryptic "grammar error: Tag" parse failure. Now it resolves the graph path from the TOML config, matching `arc run` behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
107bf743e6
commit
704cd00375
1 changed files with 9 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
use anyhow::bail;
|
||||
use arc_util::terminal::Styles;
|
||||
|
||||
use crate::cli::run_config;
|
||||
use crate::validation::Severity;
|
||||
use crate::workflow::prepare_from_file;
|
||||
|
||||
|
|
@ -12,7 +13,14 @@ use super::{print_diagnostics, ValidateArgs};
|
|||
///
|
||||
/// Returns an error if the file cannot be read, parsed, or has validation errors.
|
||||
pub fn validate_command(args: &ValidateArgs, styles: &Styles) -> anyhow::Result<()> {
|
||||
let (graph, diagnostics) = prepare_from_file(&args.workflow)?;
|
||||
let dot_path = if args.workflow.extension().is_some_and(|ext| ext == "toml") {
|
||||
let cfg = run_config::load_run_config(&args.workflow)?;
|
||||
run_config::resolve_graph_path(&args.workflow, &cfg.graph)
|
||||
} else {
|
||||
args.workflow.clone()
|
||||
};
|
||||
|
||||
let (graph, diagnostics) = prepare_from_file(&dot_path)?;
|
||||
|
||||
eprintln!(
|
||||
"{} ({} nodes, {} edges)",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue