-
Notifications
You must be signed in to change notification settings - Fork 467
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
Bug(doc): Case-sensitivity of ignored words #3210
Comments
It means typos you want to ignore must be passed to
If you think you can rephrase in a better way, pull requests would be welcome. |
What is openfortivpn? When the pattern is "manuel" and "Manuel", "manuel" and "MANUEL" are catched than this is not case sensitive. I can not rephrase something that I do not understand. sorry. |
Let me rephrase. The contents of the typo dictionary are:
If you want codespell to ignore words Manuel , manuel , MANUEL (all of them will be ignored because this part of the code is case-insensitive), you need to write --ignore-word-list=manuel , with the exact case used in the typo dictionary above, --ignore-word-list=Manuel or --ignore-word-list=MANUEL won't work.
This is because internally codespell works like this:
That's confusing, isn't it? There are two ways out of this confusion, better documenting the confusing behaviour or modifying the confusing behaviour. It might be too late to modify the behaviour. Better documentation would probably involve an explanation of the above steps, but then I feel end-users wouldn't be interested or shouldn't need to know the internals of codespell. |
Do I got that right
The A part is the identifier in the dictionary and this is case sensitive.
I do understand your explanation. But it might not be enough for a "good" docu. Are all entries (A part) in the dict are lower case? If it is the case then just tell the user to all ways add a lower case into the ignore word or even better convert each entry to lower case yourself. |
Absolutely, you got that right. No, not all AAAAAA entries in the typo dictionary are currently lower-case, but I guess they could be made lower-case. But then, why do we insist on matching AAAAAA in a case-sensitive way? @peternewman? |
I still don't get the behavior. The word "Manuel" is triggered by the dictionary entry "manuel->manual"? But codespell recommends "Manual" (the upper case version)? Maybe you should refuse to use the term "case-sensitive" and "case-insensitive". From a users perspective the word I have to add to the ignore list ist not "case sensitive" in the usual way. Because to ignore "Manuel" I have to add "manuel" which are different lower/uper cases. Asked from a users perspective: How do I decide if I have to add the lower- or upper-case version of a term (e.g. "Manuel") I would like to ignore? I am member of a maintenance team using codespell. And I have to explain my other members how to deal with situations like this in an easy and not time consuming way. |
It's actually a 3-step process:
|
Perhaps all words in the dictionaries of typos should be in lower case. Or alternatively, matching in step 1 should be made case-insensitive. Not sure why it is case-sensitive. |
It might be because of my non-native English but in my understanding
codespell
behave different then described as inhttps://github.com/codespell-project/codespell#ignoring-words .
There is written that ignore-patters are case-sensitive.
As an example
Manuel
(upper case first letter) (a usual first name in Europe) is recognized as an error andManual
is recommended.That means when I want to allow/ignore it I should put
Manuel
(upper case fist letter) in the config filesignore-word-list
. But this does not work. It work only if the pattern is lower case:Manuel
is ignored whenignore-word-list=manuel
.That confuses me.
If this is the expected behavior that the linked README section might should be rewritten?
The text was updated successfully, but these errors were encountered: