From 21dba19deccb4aacffd1c7ef1c846875304c2ecf Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 26 Sep 2023 11:01:26 -0500 Subject: [PATCH] test: Demo line-ignore behavior --- .../tests/cmd/ignore-line.in/_typos.toml | 5 +++++ .../tests/cmd/ignore-line.in/file.ignore | 3 +++ crates/typos-cli/tests/cmd/ignore-line.toml | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 crates/typos-cli/tests/cmd/ignore-line.in/_typos.toml create mode 100644 crates/typos-cli/tests/cmd/ignore-line.in/file.ignore create mode 100644 crates/typos-cli/tests/cmd/ignore-line.toml diff --git a/crates/typos-cli/tests/cmd/ignore-line.in/_typos.toml b/crates/typos-cli/tests/cmd/ignore-line.in/_typos.toml new file mode 100644 index 0000000..3a12b41 --- /dev/null +++ b/crates/typos-cli/tests/cmd/ignore-line.in/_typos.toml @@ -0,0 +1,5 @@ +[default] +extend-ignore-re = ["(?Rm)^.*# spellchecker:disable-line$"] + +[default.extend-identifiers] +hello = "goodbye" diff --git a/crates/typos-cli/tests/cmd/ignore-line.in/file.ignore b/crates/typos-cli/tests/cmd/ignore-line.in/file.ignore new file mode 100644 index 0000000..bfc4123 --- /dev/null +++ b/crates/typos-cli/tests/cmd/ignore-line.in/file.ignore @@ -0,0 +1,3 @@ +hello +hello # spellchecker:disable-line +hello diff --git a/crates/typos-cli/tests/cmd/ignore-line.toml b/crates/typos-cli/tests/cmd/ignore-line.toml new file mode 100644 index 0000000..715b2d5 --- /dev/null +++ b/crates/typos-cli/tests/cmd/ignore-line.toml @@ -0,0 +1,18 @@ +bin.name = "typos" +stdin = "" +stdout = """ +error: `hello` should be `goodbye` + --> ./file.ignore:1:1 + | +1 | hello + | ^^^^^ + | +error: `hello` should be `goodbye` + --> ./file.ignore:3:1 + | +3 | hello + | ^^^^^ + | +""" +stderr = "" +status.code = 2