Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word in ignore-words file not ignored. #2137

Open
SpenceKonde opened this issue Nov 6, 2021 · 5 comments
Open

Word in ignore-words file not ignored. #2137

SpenceKonde opened this issue Nov 6, 2021 · 5 comments
Labels

Comments

@SpenceKonde
Copy link

In my open source projects, ACn a correct abbreviation (for one of the analog comparators on the chip, which are named AC0, AC1, etc)

Of course codespell objected to it, I added it to my ignore words list and all had been well.
Until a few weeks ago.

Now that specific entry in the ignorewords file is non-functional: It does not cause "ACn" to be ignored. Other lines still work, just not that one. I've tried moving it around in the file, but that has not made a difference. My repos now fail spellchecking, and I don't know what changed or how to fix it.

The only thing that seems to be different is that this is a 3 letter word (4 and 5 letter words seem to work)

Happens in github actions and reproduces on my local machine with:
codespell --check-filenames --check-hidden --skip ./.git,.py,.gif,.jpg,.png --ignore-words megaavr/extras/ci/codespell-ignore-words-list.txt

@SpenceKonde
Copy link
Author

Interesting - it seems to be related to the casing, probably the same problem as #2026
Changing it to lowercase results tests passing again.

Sounds like word lists and letter case isn't working as documented?

@peternewman
Copy link
Collaborator

So that line in our dictionary/word list doesn't seem to have changed for ages:
1886ff3c codespell_lib/data/dictionary.txt (Peter Newman 2019-12-03 16:28:58 +0000 601) acn->can, acne,

Indeed:
https://github.com/codespell-project/codespell/blob/1886ff3c/codespell_lib/data/dictionary.txt#L465

Of course codespell objected to it, I added it to my ignore words list and all had been well.
Until a few weeks ago.

This timeline doesn't quite seem to match what I can see in your commits...

It looks like you added the ACn word here:
SpenceKonde/DxCore@6841246#diff-ca25dd74e7a61686be56f103268320fcd5bf71c18759b798e5b8f7d7e9d1e6caR47

The check after has the error:
https://github.com/SpenceKonde/DxCore/runs/3990178085?check_suite_focus=true#step:4:23

The check before doesn't (obviously):
https://github.com/SpenceKonde/DxCore/runs/3972845790?check_suite_focus=true

From the usage section:
https://github.com/codespell-project/codespell#usage

Important note: The list passed to -I is case-sensitive based on how it is listed in the codespell dictionaries.

We've had a few recent PRs to try and clarify this further, but please let us know if you've got any further suggestions to improve the wording of that help info.

lrknox added a commit to HDFGroup/hdf5 that referenced this issue Dec 7, 2021
* fixed missed closing of a dataset

* fixed missed closing of a dataset

* fixed typo in error return

* Committing clang-format changes

* minor edits

* code format

* Committing clang-format changes

* code format

* minor edit

* switched from using MPI_count, to actual bytes written for H5FD_mpio_debug rw debugging

* Committing clang-format changes

* changed size_i in printf to reflect the I/O.

* Committing clang-format changes

* Fixed seg fault with xlf on BE with -qintsize=8

* fixed error function string

* spelling corrections via codespell, added new spell check github actions

* Committing clang-format changes

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* Committing clang-format changes

* misc

* misc

* misc

* misc

* misc

* misc

* Committing clang-format changes

* misc

* work around for codespell-project/codespell#2137

* misc

* added missing file

* misc

* misc.

* misc

* switch to using Codespell with GitHub Actions

* misc.

* misc.

* fixed more sp errors

* Fix new typos found by codespell.

* fixed proceed with precede

* fixed variable in fortran test

* fixed minnum

* updated spelling list

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Larry Knox <[email protected]>
@nwalfield
Copy link

I've run into this issue as well and I also didn't understand the note (although I read it multiple times):

Important note: The list passed to -I is case-sensitive based on how it is listed in the codespell dictionaries.

I'd like to suggest the following:

The list passed to -I causes codespell to ignore the specified words in the codespell dictionaries. The list of words needs to exactly match the words as they appear in the dictionaries, including the case. That is, if codespell complains that ACn is misspelled and you want to ignore this, you need to add 'acn', not 'ACn', to the ignore list, as 'acn' is how the entry appears in the codespell dictionary.

@SpenceKonde
Copy link
Author

In terms of what would actually be the most useful for the stated goal of spell-checking code.... I would argue that that even if the base dictionary is not case sensitive, it'd be nice if the exceptions were.... Like, "acn" is totally a misspelling in my application, whereas "ACn" is the only correct way (as endorsed by the manufacturer of the hardware we're working with) to refer to "any of the AC peripherals" which they call AC0, AC1, AC2 and so on.... Similarly, "systen" would, almost anywhere, be a misspelling of "system", whereas "SYSten" might well be correct in some codebases along with "SYSone" through "SYSnine"....

Much more so than with normal language, code has lots of things where the capitalization makes the difference between a normal word and an abbreviation.....

@nwalfield
Copy link

I agree with @SpenceKonde, but I think that should be a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants