Skip to content

Commit

Permalink
bump annotate-snippets to 0.10
Browse files Browse the repository at this point in the history
FIXME colors didn't checked, as currently used renderer::plain instead of color choose, and no fail
  • Loading branch information
klensy authored and oli-obk committed Jan 24, 2024
1 parent f02168c commit 329d5f5
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 91 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Updating `cargo_metadata` to `0.18`
* Updated `spanned` to `0.1.5`, giving more precise spans for more iterator operations
* `Config::cfgs` is now `Config::program::cfg_flag`
* Bumped `annotate-snippets` to `0.10`

### Removed

Expand Down
21 changes: 9 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ comma = "1.0.0"
anyhow = "1.0.6"
indicatif = "0.17.6"
prettydiff = { version = "0.6.4", default_features = false }
annotate-snippets = { version = "0.9.1", features = ["color"] }
annotate-snippets = { version = "0.10.0" }
levenshtein = "1.0.5"
spanned = "0.1.5"

Expand Down
17 changes: 7 additions & 10 deletions src/status_emitter.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
//! Variaous schemes for reporting messages during testing or after testing is done.
use annotate_snippets::{
display_list::{DisplayList, FormatOptions},
snippet::{Annotation, AnnotationType, Slice, Snippet, SourceAnnotation},
};
use annotate_snippets::{Annotation, AnnotationType, Renderer, Slice, Snippet, SourceAnnotation};
use bstr::ByteSlice;
use colored::Colorize;
use crossbeam_channel::{Sender, TryRecvError};
Expand Down Expand Up @@ -642,13 +639,13 @@ fn create_error(
})
.collect(),
footer: vec![],
opt: FormatOptions {
color: colored::control::SHOULD_COLORIZE.should_colorize(),
anonymized_line_numbers: false,
margin: None,
},
};
println!("{}", DisplayList::from(msg));
let renderer = if colored::control::SHOULD_COLORIZE.should_colorize() {
Renderer::styled()
} else {
Renderer::plain()
};
println!("{}", renderer.render(msg));
}

fn gha_error(error: &Error, test_path: &str, revision: &str) {
Expand Down
25 changes: 11 additions & 14 deletions tests/integrations/basic-bin/Cargo.lock

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

25 changes: 11 additions & 14 deletions tests/integrations/basic-fail-mode/Cargo.lock

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

25 changes: 11 additions & 14 deletions tests/integrations/basic-fail/Cargo.lock

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

21 changes: 9 additions & 12 deletions tests/integrations/basic/Cargo.lock

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

25 changes: 11 additions & 14 deletions tests/integrations/cargo-run/Cargo.lock

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

0 comments on commit 329d5f5

Please sign in to comment.