-
Notifications
You must be signed in to change notification settings - Fork 466
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
Issue with --ignore-words? #2451
Comments
Did you read our usage doc: Specifically:
|
Um. They are all the same case??? |
Grep dictionary.txt and you'll find fro is in lower case in our dictionary. Some clever magic makes it show as upper case because your input string is upper case. Specifically:
|
If I understand correctly: I put |
Yes, put fro in your ignore list (as per the docs) and it should work as you intended. |
Seems like a good way to close this would be a README.md update including such an example. I think it's not obvious that "case-sensitive based on how it is listed in the codespell dictionaries", means that your ignore match is case-sensitive, while the dictionary match itself is case-insensitive. |
Do you mean "so if you want to ignore FRO, you'll need to add fro to your ignore list, because the codespell dictionaries feature the correction
Pull requests or comments welcome for how to make that more obvious. I must admit it's been a while since I've personally looked at that bit of code for why we don't just lower-case the ignore list but I suspect it might be to allow potential future features such as correcting javascript to JavaScript based on a case specific dictionary. Would a warning/info notification that "you've ignored FRO; it doesn't exist in the dictionary but fro does" be useful? |
Update the README to elaborate on case-sensitivity in ignored words and dictionaries. close codespell-project#2451
Took a stab at updating the README in #2466.
I think a warning might be a good idea, I expect that's the place people will look first anyways. |
@peternewman I just fell for the same issue: flagged was
That would have been very helpful indeed! |
The Edit: changing the words in the ignored list to all lower case solves the issue. I think it is a bug. |
What if I want |
The ignore words are about skipping entries that are normally in our dictionary, so you can't skip a typo from the dictionary (ACOUNT) and expect some variants of it to be flagged and others to be ignored. While I can see the benefit of this use case, I think it would be confusing for the majority of people where they want to skip a word as it's a special term in their particular domain for example. I think two things would fix your use case, in the short term, using the ignore regex option to essentially vanish aCount from the source text codespell is checking, alternatively when we add camel-case support, that will fix it properly, with the benefit of also flagging aCont as a typo too (potentially)! |
I'm new to codespell, so maybe i do something wrong here, so please bear with me 😊 I wanted to ignore the word I created a config file and added Readme file: When i changed the Shouldn't i use the same case as the word i want to ignore? |
No, that's what this issue is about clarifying. This is my current proposed change to the README: Ignoring WordsWhen ignoring false positives, note that spelling errors are case-insensitive but words to ignore are case-sensitive. For example, the dictionary entry The words to ignore can be passed in two ways:
|
Ignoring words has been a confusing part of codespell for me. @andyholmes I like your explanation on how the ignore feature works. After reading this threaded, I realize that the ignore list is not for the text or word in my source code, but for the codespell dictionary. This makes more sense as to why it must be lowercase. I think adding the warning and clearing up the description in the README (using @andyholmes description above) would be helpful to new (and current) users of codespell. |
I feel like things aren't working as they should
The text was updated successfully, but these errors were encountered: