crate-ci / typos

Source code spell checker
Apache License 2.0
2.65k stars 108 forks source link

False Positive `UIU` should be `YOU` #1002

Open xavier2k6 opened 6 months ago

xavier2k6 commented 6 months ago

typos 1.20.9

UIU of WebUIUPnp is being falsely detected as YOU

WebUI is an abbreviation/acronym for Web User Interface UPnP is an abbreviation/acronym for Universal Plug and Play

Screenshot 2024-04-17 183951

epage commented 6 months ago

Currently, our word splitting strictly follows CamelCase and so it splits checkWebUIUPnP as check Web UIU Pn P. You can see this by running typos --words

This is somewhat like #466 where some "identifiers" don't follow standard conventions. So far, we've not come up with a better plan for handling these cases.

These cases can be worked around by

xavier2k6 commented 6 months ago

@epage Thanks for the tip!

Modified .typos.toml & now passed.

[default.extend-words]
BA = "BA"
helo = "helo"
UIU = "UIU"
Pn = "Pn"
szepeviktor commented 6 months ago

It is rather

[default.extend-identifiers]
checkWebUIUPnP = "checkWebUIUPnP"