crate-ci / typos

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

When locale is set to en-au (and presumably other non-us locales) typos identifies CSS and SVG property values as typos #1097

Open wezm opened 1 month ago

wezm commented 1 month ago
error: `maximized` should be `maximised`
  --> ./favicon.svg:36:22
   |
36 |      inkscape:window-maximized="1"
   |                      ^^^^^^^^^
   |
error: `center` should be `centre`
  --> ./static/style.css:88:14
   |
88 |  text-align: center;
   |              ^^^^^^
   |
error: `capitalize` should be `capitalise`
  --> ./static/style.css:362:18
    |
362 |  text-transform: capitalize;
    |                  ^^^^^^^^^^

I have worked around this by disabling checking of these files.

epage commented 1 month ago

Users can workaround this in their config by blessing the words or identifiers.

typos has no knowledge of the syntax of different formats. The only built-in option is to we providing a built-in list for CSS-specific like a user could do that work in American English but not other dialects. Frankly, I somewhat regret dialect support for cases like this. Its less common for "typos" to show up in APIs. However, it feels like it might be a game of whack-a-mole to deal with all of the exception cases for non-American dialects in programming.

wezm commented 1 month ago

Fair enough. I had assumed it had more knowledge of syntax than it does. Seems reasonable to close as not planned.