diff --git a/crates/ruff/src/commands/check.rs b/crates/ruff/src/commands/check.rs index b33dcfe8cb..0c0ed5995b 100644 --- a/crates/ruff/src/commands/check.rs +++ b/crates/ruff/src/commands/check.rs @@ -279,6 +279,7 @@ mod test { TextEmitter::default() .with_show_fix_status(true) + .with_color(false) .emit( &mut output, &diagnostics.inner, diff --git a/crates/ruff_linter/src/message/text.rs b/crates/ruff_linter/src/message/text.rs index 5659306d81..265f717b27 100644 --- a/crates/ruff_linter/src/message/text.rs +++ b/crates/ruff_linter/src/message/text.rs @@ -76,6 +76,12 @@ impl TextEmitter { self.config = self.config.preview(preview); self } + + #[must_use] + pub fn with_color(mut self, color: bool) -> Self { + self.config = self.config.color(color); + self + } } impl Emitter for TextEmitter {