typos icon indicating copy to clipboard operation
typos copied to clipboard

False Positive `UIU` should be `YOU`

Open xavier2k6 opened this issue 1 year ago • 3 comments

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

xavier2k6 avatar Apr 17 '24 17:04 xavier2k6

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

  • Marking that identifier valid
  • Marking identifiers with WebUI or UPnP as valid via regex

epage avatar Apr 17 '24 18:04 epage

@epage Thanks for the tip!

Modified .typos.toml & now passed.

[default.extend-words]
BA = "BA"
helo = "helo"
UIU = "UIU"
Pn = "Pn"

xavier2k6 avatar Apr 17 '24 18:04 xavier2k6

It is rather

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

szepeviktor avatar Apr 21 '24 12:04 szepeviktor