codespell-project / actions-codespell

MIT License
74 stars 19 forks source link

Stopped ignoring configured words #48

Closed Nadyita closed 2 years ago

Nadyita commented 2 years ago

Since the last commit, it seems, codespell started flagging the word hasTable as a typo of hashable. I added that word to my .codespellrc ignore-words-list, but to no avail. I trhen added it with

        - name: Run Codespell
          uses: codespell-project/actions-codespell@master
          with:
            ignore_words_list: hasTable

but it's still being flagged. How can I ignore this error? this action run shows the mistake,

per1234 commented 2 years ago

Hi @Nadyita. Even though spell checking of the content is case-insensitive, the handling of the ignore-words-list configuration is case-sensitive. So the word in this list must match the case of the misspelled word entry in the dictionary. The dictionary is all lowercase:

https://github.com/codespell-project/codespell/blob/v2.2.1/codespell_lib/data/dictionary.txt#L16852

hastable->hashtable

So you can ignore this word with the following .codespellrc file entry:

ignore-words-list = hastable

This is how the ignore system has always worked. The reason for the appearance of the problem was simply that you are now using a newer version of codespell in which this dictionary entry was added.

Nadyita commented 2 years ago

@per1234 Oh yes, that works. Confusing, and probably something I should report as an upstream bug to codespell. Words on the ignore list should either be ingested lower case, or at least a warning should be given, if the given word is not in the dictionary. Sorry for wasting your time!