mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-24 18:10:56 -05:00
test(cli): Verify block-ignores via regex
This commit is contained in:
parent
c4bcca1d18
commit
8b57110b76
3 changed files with 28 additions and 0 deletions
5
crates/typos-cli/tests/cmd/ignore-block.in/_typos.toml
Normal file
5
crates/typos-cli/tests/cmd/ignore-block.in/_typos.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
[default]
|
||||
extend-ignore-re = ["#\\s*spellchecker:off\\s*\\n.*\\n\\s*#\\s*spellchecker:on"]
|
||||
|
||||
[default.extend-identifiers]
|
||||
hello = "goodbye"
|
5
crates/typos-cli/tests/cmd/ignore-block.in/file.ignore
Normal file
5
crates/typos-cli/tests/cmd/ignore-block.in/file.ignore
Normal file
|
@ -0,0 +1,5 @@
|
|||
hello
|
||||
# spellchecker:off
|
||||
hello
|
||||
# spellchecker:on
|
||||
hello
|
18
crates/typos-cli/tests/cmd/ignore-block.toml
Normal file
18
crates/typos-cli/tests/cmd/ignore-block.toml
Normal file
|
@ -0,0 +1,18 @@
|
|||
bin.name = "typos"
|
||||
stdin = "--sort"
|
||||
stdout = """
|
||||
error: `hello` should be `goodbye`
|
||||
--> ./file.ignore:1:1
|
||||
|
|
||||
1 | hello
|
||||
| ^^^^^
|
||||
|
|
||||
error: `hello` should be `goodbye`
|
||||
--> ./file.ignore:5:1
|
||||
|
|
||||
5 | hello
|
||||
| ^^^^^
|
||||
|
|
||||
"""
|
||||
stderr = ""
|
||||
status.code = 2
|
Loading…
Reference in a new issue