Needed a `(?s)` to match multiple enclosed newlines. And added a
non-greedy modifier and matching test to prevent double blocks from
causing intermediate lines to be ignored:
```shell
# spellchecker:off
should be ignored
# spellchecker:on
should not be ignored # without non-greedy, this is also ignored
# spellchecker:off
should be ignored
# spellchecker:on
```
Typos primarily works off of identifiers and words. We have built-in
support to detect constructs that span identifiers that should not be
spell checked, like UUIDs, emails, domains, etc. This opens it up for
for user-defined identifier-spanning constructs using regexes via
`extend-ignore-re`.
This works differently than any of the previous ways of ignoring thing
because the regexes require extra parse passes. Under the assumption
that (1) actual typos are rare and (2) number of files relying on
`extend-ignore-re` are rare, we only do these extra parse passes when a
typo is found, causing almost no performance hit in the expected case.
While this could be used for more generic types of ignores, it isn't the
most maintainable because it is separate from the source files in
question. Ideally, we'd implement document settings / directives for
these cases (#316).
This opens the door for users to provide patterns for identifiers that
are always valid. The key limitation is "identifiers". Run `typos
--identifiers` to verify what you are trying to write the regex for.
Fixes#651
This is prep for other items to be ignored
BREAKING CHANGE: `TokenizerBuilder` no longer takes config for ignoring
tokens. Related, we now ignore token-ignore config flags.
We want both CLI and config ignores. The question then is what we make
them relative to. I decided to favor CLI with `.`. We'll see how this
works out
Fixes#134
In preparing for smarter handling of config, we need to be able to tell
what is present and what isn't.
BREAKING CHANGE: `--hex` was removed, the value didn't seem high enough.
This reverts commit 0052617fcd.
The fix for #134 was backwards. It turns out `overrides` is for
including rather than ignoring. Will need to look at this further.
Sometimes you just have to live with a typo or its done intentionally
(like weird company names). With this commit, a user can now identifier
blessed identifiers and words.
This is ostly what is needed for #9 but sometimes people will have
common typos that they'll want to provide corrections for.
THis is to help with cases like a monorepo with vendored dependencies.
A user might want to search (`.ignore`) them but not hold the code to
the same standards as first-party code.
Fixes#134
The goal is to be as accepting and unobtrusive to new code bases as
possible. To this end, we correct typos into the closest english
dialect.
If someone wants to opt-in, they can have typos correct to a specific
english dialect.
Fixes#52Fixes#22