Skip to content

Commit

Permalink
Merge pull request #1026 from noahp/noahp/dotall
Browse files Browse the repository at this point in the history
docs(ref): Add dotall specifier to block ignore
  • Loading branch information
epage committed Jun 4, 2024
2 parents d9da472 + c7a34fc commit 160c60d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/typos-cli/tests/cmd/ignore-block.in/_typos.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[default]
extend-ignore-re = ["#\\s*spellchecker:off\\s*\\n.*\\n\\s*#\\s*spellchecker:on"]
extend-ignore-re = ["(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on"]

[default.extend-identifiers]
hello = "goodbye"
6 changes: 5 additions & 1 deletion crates/typos-cli/tests/cmd/ignore-block.in/file.ignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
hello
# spellchecker:off
hello
# spellchecker:on
henlo
// spellchecker:on
hello
// ensure greedy doesn't exclude everything across blocks
# spellchecker:off
# spellchecker:on
4 changes: 2 additions & 2 deletions crates/typos-cli/tests/cmd/ignore-block.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ error: `hello` should be `goodbye`
| ^^^^^
|
error: `hello` should be `goodbye`
--> ./file.ignore:5:1
--> ./file.ignore:6:1
|
5 | hello
6 | hello
| ^^^^^
|
"""
Expand Down
4 changes: 2 additions & 2 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Configuration is read from the following (in precedence order)
| type.\<name>.extend-glob | \- | list of strings | File globs for matching `<name>` |

Common `extend-ignore-re`:
- Line ignore with trailing `# spellchecker:disable-line`: `"(?Rm)^.*#\\s*spellchecker:disable-line$"`
- Line block with `# spellchecker:<on|off>`: `"#\\s*spellchecker:off\\s*\\n.*\\n\\s*#\\s*spellchecker:on"`
- 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"`

Common `extend-ignore-identifiers-re`:
- SSL Cipher suites: `"\\bTLS_[A-Z0-9_]+(_anon_[A-Z0-9_]+)?\\b"`

0 comments on commit 160c60d

Please sign in to comment.