mirror of
https://github.com/crate-ci/typos.git
synced 2026-11-14 18:13:52 +01:00
Merge pull request #1342 from epage/next
docs(ref): Include example of ignore-next-line
This commit is contained in:
4 files changed
+30
No files matched your search
@@ -0,0 +1,5 @@
|
||||
[default]
|
||||
extend-ignore-re = ["(#|//)\\s*spellchecker:ignore-next-line\\n.*"]
|
||||
|
||||
[default.extend-identifiers]
|
||||
hello = "goodbye"
|
||||
@@ -0,0 +1,6 @@
|
||||
hello
|
||||
# spellchecker:ignore-next-line
|
||||
hello
|
||||
# spellchecker:ignore-next-line
|
||||
henlo
|
||||
hello
|
||||
@@ -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:6:1
|
||||
|
|
||||
6 | hello
|
||||
| ^^^^^
|
||||
|
|
||||
"""
|
||||
stderr = ""
|
||||
status.code = 2
|
||||
@@ -44,6 +44,7 @@ Configuration is read from the following (in precedence order)
|
||||
Common `extend-ignore-re`:
|
||||
- Line ignore with trailing `# spellchecker:disable-line`: `"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$"`
|
||||
- Line block with `# spellchecker:<on|off>`: `"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on"`
|
||||
- Next-line ignore `# spellchecker:ignore-next-line`: `(#|//)\\s*spellchecker:ignore-next-line\\n.*`
|
||||
- See also [ripsecret's regexes](https://github.com/sirwart/ripsecrets/blob/main/src/lib.rs)
|
||||
|
||||
Common `extend-ignore-identifiers-re`:
|
||||
|
||||
Reference in new issue
Block a user