diff --git a/cli/src/command/poll.rs b/cli/src/command/poll.rs index 3c201fb..dd35ac9 100644 --- a/cli/src/command/poll.rs +++ b/cli/src/command/poll.rs @@ -21,7 +21,7 @@ use std::sync::Mutex; use serde::Deserialize; use tabled::Tabled; -use crate::formatter::{error_without_trace, info, success, success_table}; +use crate::formatter::{error_without_trace, info, success, success_table, warn_without_trace}; const DEFAULT_CONFIG: &str = "./collector.toml"; @@ -52,9 +52,9 @@ pub struct Source { pub env: BTreeMap, #[serde(default)] pub layout: Layout, - /// Modules this source is expected to produce. Polling fails if any of - /// them is missing afterwards, so a producer that silently stops emitting - /// a module cannot slip into a release. + /// Modules this source is expected to produce. Polling warns, rather + /// than failing, if one of them is missing afterwards -- useful while a + /// module is still under development and not always exported yet. pub modules: Vec, } @@ -169,10 +169,11 @@ pub fn poll( for module in &source.modules { let module_dir = out_dir.join(module); if !module_dir.is_dir() { - fail(format!( - "`{}` finished without producing the module `{}` it declares in {}.", + warn_without_trace(format!( + "`{}` finished without producing the module `{}` it declares in {}. Skipping it.", source.name, module, config_path )); + continue; } verify_module(&module_dir, &source.name, module); diff --git a/cli/src/formatter.rs b/cli/src/formatter.rs index 03aab8c..0c00021 100644 --- a/cli/src/formatter.rs +++ b/cli/src/formatter.rs @@ -30,6 +30,10 @@ pub fn error_without_trace(string: String) { println!("\n{}: {}", "error".red(), string) } +pub fn warn_without_trace(string: String) { + println!("\n{}: {}", "warning".yellow(), string) +} + pub fn error_highlight(highlight: String, string: String) { println!("{} {}", highlight.red(), string); } diff --git a/collector.toml b/collector.toml index b86f56c..acfc6af 100644 --- a/collector.toml +++ b/collector.toml @@ -18,6 +18,10 @@ out = "./definitions" # "tree" -- writes one directory per module into the directory it is # given, so it is handed ``. This is what a taurus export # built on `build_modules()` does. +# +# `modules` lists the modules a source is expected to produce. Polling warns +# and skips one that is missing rather than failing, so a module still under +# development doesn't need to be exported every time. [[source]] name = "taurus"