crate-ci / typos

Source code spell checker
Apache License 2.0
2.52k stars 96 forks source link

Typos flagging hostname #435

Open mynamewastaken opened 2 years ago

mynamewastaken commented 2 years ago
error: `ot` should be `to`, `of`, `or`
  --> docs/content/team/poc/zerto.md:49:27
   |
49 | - Source computer name was ot01dv-zerto002.centralus.xxx.cloud but replica was ot01dv-zerto002. Might have to solve this with post script
   |                            ^^
   |

I can exclude this specific case, but is there a way to generalize this? Maybe regex to ignore anything that's . separated?

epage commented 2 years ago

The problem with ignoring . separated is that will ignore class.member. In most languages, that can work because a declaration of member exists and we'd spell check that. In a language like Python, we would lose spell checking of member variables.

mynamewastaken commented 2 years ago

I understand. Our use case is markdown files with occasional snippets of embedded code (hcl, bash, go, python, etc). Are there knobs I can turn on the user side? Something by filetype perhaps? I saw the examples, but it doesn't look like it would be fine-grained enough to say something like ignore oython-specific rules in a non-python file.

In any case thanks for your work on this; I tied typos into our documentation pipeline, so if you have typos your doc doesn't get published. Works wonder for spelling errors. ;)

epage commented 2 years ago

Are there knobs I can turn on the user side?

At the moment, this is not configurable at all. I was just giving the motivation and realizing that motivation can be narrowed in scope by relying on declarations.

We could abandon class members, sacrificing some Python spell checking, or make it configurable with a default for Python (atm nothing this deep in the parser is configurable).

I'm a bit mixed on which direction (including "do nothing") to go.

epage commented 1 year ago

FYI #695 provides a new workaround for false positives