Skip to content

Commit

Permalink
Update Rust crate owo-colors to v4 (#1178)
Browse files Browse the repository at this point in the history
Co-authored-by: Rain <[email protected]>
  • Loading branch information
nextest-bot and sunshowers authored Dec 21, 2023
1 parent 91fc7c2 commit 5e9b2d8
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 234 deletions.
59 changes: 18 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion cargo-nextest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ nextest-filtering = { version = "=0.7.0", path = "../nextest-filtering" }
nextest-runner = { version = "=0.52.2", path = "../nextest-runner" }
nextest-metadata = { version = "=0.10.0", path = "../nextest-metadata" }
once_cell = "1.19.0"
owo-colors = { version = "3.5.0", features = ["supports-colors"] }
owo-colors = { version = "4.0.0", features = ["supports-colors"] }
# owo-colors 3 is required for miette v5 styling
owo-colors-3 = { package = "owo-colors", version = "3.5.0" }
pathdiff = { version = "0.2.1", features = ["camino"] }
semver = "1.0.20"
shell-words = "1.1.0"
Expand Down
17 changes: 8 additions & 9 deletions cargo-nextest/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use crate::{
cargo_cli::{CargoCli, CargoOptions},
output::{OutputContext, OutputOpts, OutputWriter, SupportsColorsV2},
output::{OutputContext, OutputOpts, OutputWriter},
reuse_build::{make_path_mapper, ArchiveFormatOpt, ReuseBuildOpts},
ExpectedError, Result, ReuseBuildKind,
};
Expand Down Expand Up @@ -37,7 +37,7 @@ use nextest_runner::{
test_filter::{RunIgnored, TestFilterBuilder},
};
use once_cell::sync::OnceCell;
use owo_colors::{OwoColorize, Style};
use owo_colors::{OwoColorize, Stream, Style};
use semver::Version;
use std::{
collections::BTreeSet,
Expand All @@ -46,7 +46,6 @@ use std::{
io::{Cursor, Write},
sync::Arc,
};
use supports_color::Stream;

/// A next-generation test runner for Rust.
///
Expand Down Expand Up @@ -1104,8 +1103,8 @@ impl BaseApp {
} => {
log::warn!(
"this repository recommends nextest version {}, but the current version is {}",
required.if_supports_color_2(Stream::Stderr, |x| x.bold()),
current.if_supports_color_2(Stream::Stderr, |x| x.bold()),
required.if_supports_color(Stream::Stderr, |x| x.bold()),
current.if_supports_color(Stream::Stderr, |x| x.bold()),
);
if let Some(tool) = tool {
log::info!(
Expand Down Expand Up @@ -1182,8 +1181,8 @@ impl BaseApp {
} => {
log::warn!(
"this repository recommends nextest version {}, but the current version is {}",
required.if_supports_color_2(Stream::Stderr, |x| x.bold()),
current.if_supports_color_2(Stream::Stderr, |x| x.bold()),
required.if_supports_color(Stream::Stderr, |x| x.bold()),
current.if_supports_color(Stream::Stderr, |x| x.bold()),
);
if let Some(tool) = tool {
log::info!(
Expand Down Expand Up @@ -1938,7 +1937,7 @@ fn log_platform_runner(prefix: &str, runner: &PlatformRunner) {
let runner_command = shell_words::join(std::iter::once(runner.binary()).chain(runner.args()));
log::info!(
"{prefix}using target runner `{}` defined by {}",
runner_command.if_supports_color_2(Stream::Stderr, |s| s.bold()),
runner_command.if_supports_color(Stream::Stderr, |s| s.bold()),
runner.source()
)
}
Expand All @@ -1951,7 +1950,7 @@ fn warn_on_err(thing: &str, err: &(dyn std::error::Error)) -> Result<(), std::fm
write!(
s,
"\n {} {}",
"caused by:".if_supports_color_2(Stream::Stderr, |s| s.style(Style::new().yellow())),
"caused by:".if_supports_color(Stream::Stderr, |s| s.style(Style::new().yellow())),
err
)?;
next_error = err.source();
Expand Down
Loading

0 comments on commit 5e9b2d8

Please sign in to comment.