mirror of https://github.com/zkat/miette.git
feat(deps): remove is-terminal dep in favor of `std::io::IsTerminal`
This commit is contained in:
parent
e65d0a78cc
commit
e5c7ae469e
|
|
@ -27,11 +27,11 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
features: [fancy, syntect-highlighter]
|
||||
rust: [1.56.0, stable]
|
||||
rust: [1.70.0, stable]
|
||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||
exclude:
|
||||
- features: syntect-highlighter
|
||||
rust: 1.56.0
|
||||
rust: 1.70.0
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -41,7 +41,7 @@ jobs:
|
|||
toolchain: ${{ matrix.rust }}
|
||||
components: clippy
|
||||
- name: Force older version of is-terminal for MSRV builds
|
||||
if: matrix.rust == '1.56.0'
|
||||
if: matrix.rust == '1.70.0'
|
||||
run: cargo update -p is-terminal --precise 0.4.7
|
||||
- name: Clippy
|
||||
run: cargo clippy --all -- -D warnings
|
||||
|
|
@ -49,7 +49,7 @@ jobs:
|
|||
if: matrix.rust == 'stable'
|
||||
run: cargo test --all --verbose --features ${{matrix.features}}
|
||||
- name: Run tests
|
||||
if: matrix.rust == '1.56.0'
|
||||
if: matrix.rust == '1.70.0'
|
||||
run: cargo test --all --verbose --features ${{matrix.features}} no-format-args-capture
|
||||
|
||||
miri:
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@ once_cell = "1.8.0"
|
|||
unicode-width = "0.1.9"
|
||||
|
||||
owo-colors = { version = "3.4.0", optional = true }
|
||||
is-terminal = { version = "0.4.0", optional = true }
|
||||
textwrap = { version = "0.15.0", optional = true }
|
||||
supports-hyperlinks = { version = "2.0.0", optional = true }
|
||||
supports-color = { version = "2.0.0", optional = true }
|
||||
supports-unicode = { version = "2.0.0", optional = true }
|
||||
supports-hyperlinks = { version = "3.0.0", optional = true }
|
||||
supports-color = { version = "3.0.0", optional = true }
|
||||
supports-unicode = { version = "3.0.0", optional = true }
|
||||
backtrace = { version = "0.3.61", optional = true }
|
||||
terminal_size = { version = "0.3.0", optional = true }
|
||||
backtrace-ext = { version = "0.2.1", optional = true }
|
||||
|
|
@ -51,7 +50,6 @@ derive = ["miette-derive"]
|
|||
no-format-args-capture = []
|
||||
fancy-no-backtrace = [
|
||||
"owo-colors",
|
||||
"is-terminal",
|
||||
"textwrap",
|
||||
"terminal_size",
|
||||
"supports-hyperlinks",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use is_terminal::IsTerminal;
|
||||
use std::io::IsTerminal;
|
||||
|
||||
use owo_colors::Style;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ impl LabeledSpan {
|
|||
pub const fn new(label: Option<String>, offset: ByteOffset, len: usize) -> Self {
|
||||
Self {
|
||||
label,
|
||||
span: SourceSpan::new(SourceOffset(offset), SourceOffset(len)),
|
||||
span: SourceSpan::new(SourceOffset(offset), len),
|
||||
primary: false,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1842,11 +1842,11 @@ fn syntax_highlighter_on_real_file() {
|
|||
let expected = format!(
|
||||
r#" × This is an error
|
||||
╭─[{filename}:{l2}:{CO}]
|
||||
{l1} │
|
||||
{l1} │
|
||||
{l2} │ let (filename, line) = (file!(), line!() as usize);
|
||||
· ─────────────┬─────────────
|
||||
· ╰── this is a label
|
||||
{l3} │
|
||||
{l3} │
|
||||
╰────
|
||||
"#,
|
||||
l1 = line - 1,
|
||||
|
|
@ -1855,6 +1855,7 @@ fn syntax_highlighter_on_real_file() {
|
|||
);
|
||||
assert!(out.contains("\u{1b}[38;2;180;142;173m"));
|
||||
assert_eq!(expected, strip_ansi_escapes::strip_str(out));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn triple_adjacent_highlight() -> Result<(), MietteError> {
|
||||
|
|
@ -1888,13 +1889,13 @@ fn triple_adjacent_highlight() -> Result<(), MietteError> {
|
|||
1 │ source
|
||||
· ───┬──
|
||||
· ╰── this bit here
|
||||
2 │
|
||||
3 │
|
||||
2 │
|
||||
3 │
|
||||
4 │ text
|
||||
· ──┬─
|
||||
· ╰── also this bit
|
||||
5 │
|
||||
6 │
|
||||
5 │
|
||||
6 │
|
||||
7 │ here
|
||||
· ──┬─
|
||||
· ╰── finally we got
|
||||
|
|
@ -1934,10 +1935,10 @@ fn non_adjacent_highlight() -> Result<(), MietteError> {
|
|||
1 │ source
|
||||
· ───┬──
|
||||
· ╰── this bit here
|
||||
2 │
|
||||
2 │
|
||||
╰────
|
||||
╭─[bad_file.rs:5:3]
|
||||
4 │
|
||||
4 │
|
||||
5 │ text here
|
||||
· ──┬─
|
||||
· ╰── also this bit
|
||||
|
|
|
|||
Loading…
Reference in New Issue