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
33 changes: 0 additions & 33 deletions e2e/tasks/test_task_unnest

This file was deleted.

8 changes: 1 addition & 7 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ impl Run {
}
}
}
if this.timings() && num_tasks > 1 && *env::MISE_TASK_LEVEL == 0 {
if this.timings() && num_tasks > 1 {
let msg = format!("Finished in {}", time::format_duration(timer.elapsed()));
eprintln!("{}", style::edim(msg));
};
Expand Down Expand Up @@ -621,12 +621,6 @@ impl Run {
let mut env = task.render_env(config, &ts).await?;
let output = self.output(Some(task));
env.insert("MISE_TASK_OUTPUT".into(), output.to_string());
if output == TaskOutput::Prefix {
env.insert(
"MISE_TASK_LEVEL".into(),
(*env::MISE_TASK_LEVEL + 1).to_string(),
);
}
if !self.timings {
env.insert("MISE_TASK_TIMINGS".to_string(), "0".to_string());
}
Expand Down
1 change: 0 additions & 1 deletion src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ pub static MISE_IGNORED_CONFIG_PATHS: Lazy<Vec<PathBuf>> = Lazy::new(|| {
})
.unwrap_or_default()
});
pub static MISE_TASK_LEVEL: Lazy<u8> = Lazy::new(|| var_u8("MISE_TASK_LEVEL"));
pub static MISE_USE_TOML: Lazy<bool> = Lazy::new(|| !var_is_false("MISE_USE_TOML"));
pub static MISE_LIST_ALL_VERSIONS: Lazy<bool> = Lazy::new(|| var_is_true("MISE_LIST_ALL_VERSIONS"));
pub static ARGV0: Lazy<String> = Lazy::new(|| ARGS.read().unwrap()[0].to_string());
Expand Down
26 changes: 2 additions & 24 deletions src/output.rs
Original file line number Diff line number Diff line change
@@ -1,41 +1,19 @@
use regex::Regex;
use std::collections::HashSet;
Copy link

Copilot AI Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex import was removed but the HashSet import remains. Verify that HashSet is still used elsewhere in this file, otherwise it should also be removed.

Suggested change
use std::collections::HashSet;

Copilot uses AI. Check for mistakes.
use std::sync::LazyLock;
use std::sync::Mutex;

pub static UNNEST_RE: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r#"MISE_TASK_UNNEST:(\d+):MISE_TASK_UNNEST (.*)"#).unwrap());

#[macro_export]
macro_rules! prefix_println {
($prefix:expr, $($arg:tt)*) => {{
let msg = format!($($arg)*);
if let Some(msg) = $crate::output::UNNEST_RE.captures(&msg) {
let level = msg.get(1).unwrap().as_str().parse::<usize>().unwrap();
if level > 1 {
println!("MISE_TASK_UNNEST:{}:MISE_TASK_UNNEST {}", level - 1, msg.get(2).unwrap().as_str());
} else {
println!("{}", msg.get(2).unwrap().as_str());
}
} else {
println!("{} {}", $prefix, msg);
}
println!("{} {}", $prefix, msg);
}};
}
#[macro_export]
macro_rules! prefix_eprintln {
($prefix:expr, $($arg:tt)*) => {{
let msg = format!($($arg)*);
if let Some(msg) = $crate::output::UNNEST_RE.captures(&msg) {
let level = msg.get(1).unwrap().as_str().parse::<usize>().unwrap();
if level > 1 {
eprintln!("MISE_TASK_UNNEST:{}:MISE_TASK_UNNEST {}", level - 1, msg.get(2).unwrap().as_str());
} else {
eprintln!("{}", msg.get(2).unwrap().as_str());
}
} else {
eprintln!("{} {}", $prefix, msg);
}
eprintln!("{} {}", $prefix, msg);
}};
}

Expand Down
11 changes: 2 additions & 9 deletions src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,15 +500,8 @@ impl Task {
]
});
let idx = self.display_name.chars().map(|c| c as usize).sum::<usize>() % COLORS.len();
let prefix = style::ereset() + &style::estyle(self.prefix()).fg(COLORS[idx]).to_string();
if *env::MISE_TASK_LEVEL > 0 {
format!(
"MISE_TASK_UNNEST:{}:MISE_TASK_UNNEST {prefix}",
*env::MISE_TASK_LEVEL
)
} else {
prefix
}

style::ereset() + &style::estyle(self.prefix()).fg(COLORS[idx]).to_string()
}

pub async fn dir(&self, config: &Arc<Config>) -> Result<Option<PathBuf>> {
Expand Down
Loading