crate-ci / typos

Source code spell checker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`extend-ignore-identifiers-re` does not work (example)

jonashaag opened this issue · comments

$ cat example.txt
[indikation]

$ cat _typos.toml
[default]
extend-ignore-identifiers-re = [
  "\\[[\\w_]+\\]", # [col]
]

$ ~/Downloads/typos-v1.18.2-aarch64-apple-darwin/typos example.txt
error: `indikation` should be `indication`
  --> example.txt:1:2
  |
1 | [indikation]
  |  ^^^^^^^^^^
  |

But the regex seems to be OK:

$ python3
>>> import toml, re
>>> re.match(toml.load(open("_typos.toml"))['default']['extend-ignore-identifiers-re'][0], "[indikation]")
<re.Match object; span=(0, 12), match='[indikation]'>

Am I misunderstanding how that option works?

extend-ignore-identifiers-re only applies to identifiers. See typos --identifiers for what that applies to.

If you switch to default.extend-ignore-re, then it works.

Thank you!