Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions cli/src/command/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -52,9 +52,9 @@ pub struct Source {
pub env: BTreeMap<String, String>,
#[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<String>,
}

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions cli/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions collector.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ out = "./definitions"
# "tree" -- writes one directory per module into the directory it is
# given, so it is handed `<out>`. 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"
Expand Down