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

Unexpected behaviour of ignore-words-list when handling cases #3584

Open
DanielYang59 opened this issue Nov 21, 2024 · 0 comments
Open

Unexpected behaviour of ignore-words-list when handling cases #3584

DanielYang59 opened this issue Nov 21, 2024 · 0 comments

Comments

@DanielYang59
Copy link
Contributor

DanielYang59 commented Nov 21, 2024

Behaviour of ignore-words-list seems different than a single ignore pattern (the latter has to match its case as in the dictionarty):

-L WORDS, --ignore-words-list WORDS
comma-separated list of words to be ignored by
codespell. Words are case sensitive based on how they
are written in the dictionary file.

Say I have typo titel in target file, and using pattern titel works while TITEL doesn't (as expected). Then I have another typo Mater in target file, and using both Mater/mater seems to work (why? the dict entry is mater and I didn't find another entry as Mater).

For example for test file (as .py):

titel = 0

Mater = 1
# Expected behaviour
>>> codespell --ignore-words-list titel test_words_list.py
test_words_list.py:3: Mater ==> Matter, Master, Mother

>>> codespell --ignore-words-list TITEL test_words_list.py 
test_words_list.py:1: titel ==> title
test_words_list.py:3: Mater ==> Matter, Master, Mother


# Unexpected, why both Mater and mater work (dict entry is "mater")
>>> codespell --ignore-words-list Mater test_words_list.py 
test_words_list.py:1: titel ==> title

>>> codespell --ignore-words-list mater test_words_list.py 
test_words_list.py:1: titel ==> title
@DanielYang59 DanielYang59 changed the title Behaviour of ignore-words-list seem different than a single ignore pattern Unexpected behaviour of ignore-words-list when handling cases Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant