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

Bug? ignore-words-list seems to have no effect #2375

Open
joshgoebel opened this issue Jun 23, 2022 · 16 comments
Open

Bug? ignore-words-list seems to have no effect #2375

joshgoebel opened this issue Jun 23, 2022 · 16 comments
Labels

Comments

@joshgoebel
Copy link

joshgoebel commented Jun 23, 2022

Am I doing something wrong? How can I get it to stop flagging MSDOS as an error? ignore-words-list seems to have no effect

> codespell
./src/keyszer/models/key.py:161: MSDOS ==> MS-DOS

My config:

[codespell]
ignore-words-list = MSDOS
skip = .venv,.git,build,keyszer.egg-info
@peternewman
Copy link
Collaborator

Like so:

[codespell]
ignore-words-list = msdos
skip = .venv,.git,build,keyszer.egg-info

Which admittedly doesn't match our docs:
https://github.com/codespell-project/codespell/#usage

Based on:

@joshgoebel
Copy link
Author

joshgoebel commented Jun 23, 2022

That's it - fixes the issue, but yeah the way i read the docs was that I should try to match case...

Perhaps we need a docfix?

@peternewman
Copy link
Collaborator

[key, data] = line.split('->')
# TODO for now, convert both to lower. Someday we can maybe add
# support for fixing caps.
key = key.lower()
data = data.lower()
if key in ignore_words:
continue

I think the issue may be that MSDOS is one of the few entries which is upper case in the dictionary, hence flagging this issue.

@mwestphal
Copy link

Looks like there is a case issue:

nNumber ==> number
ignore-words-list=nNumber

Not excluded

ignore-words-list=nnumber

excluded successfully.

@peternewman
Copy link
Collaborator

Looks like there is a case issue:

Yeah our comparison to match the dictionary from the ignore list is happening with different case requirements to what we claim in the docs.

@yarikoptic
Copy link
Contributor

FWIW just ran into this issue and was about to complain as well -- would be great to have it fixed, as to conform to the promise of being case sensitive. My use case:

❯ codespell --help | grep -A3 -e ' -L'
  -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
❯ cat spellme.txt
Ingress for Microsoft Azure Kubernetes Service (AKS)
❯ codespell -L AKS spellme.txt
spellme.txt:1: AKS ==> ASK
❯ codespell --version
2.2.2

so I would dislike completely avoiding fixing aks into ask ;)

@iamibi
Copy link

iamibi commented Sep 25, 2023

I am facing a similar issue mentioned here. When using ignore-words-list as part of pyproject.toml to ignore "OT" as a words, it is not respecting it.
full configuration for codespell

[tool.codespell]
quiet-level = 0
skip = "poetry.lock"
ignore-words-list = "OT"

Any suggestions?

@yarikoptic
Copy link
Contributor

I some times add those into ignore-regex instead with end of the word boundary, like ignore-regex = "\bOT\b" if I want to retain regular to to be a typo to be detected.

@DimitriPapadopoulos
Copy link
Collaborator

@iamibi As already explained:

ignore-words-list = "ot"

@yarikoptic
Copy link
Contributor

that would also skip lower case ot and I thought that the goal here is to just skip upper cased OT only.

99991 added a commit to pymatting/pymatting that referenced this issue Oct 5, 2023
@perillo
Copy link
Contributor

perillo commented Dec 18, 2023

I'm having a similar problem when checking Zig source files.
codespell refuses to ignore ACCES and WRONLY.

@DimitriPapadopoulos
Copy link
Collaborator

@perillo What's your question ?

@perillo
Copy link
Contributor

perillo commented Dec 18, 2023

@perillo What's your question ?

Looking at the comments, I assumed that using lowercase for ignore words was a temporary fix. However https://github.com/codespell-project/codespell/#ignoring-words documents that this is the expected behavior.

Thanks.

@nkozheninEvinced

This comment was marked as off-topic.

@DimitriPapadopoulos

This comment was marked as off-topic.

saraedum added a commit to saraedum/intervalxt that referenced this issue Dec 28, 2023
@MercuryDemo

This comment was marked as duplicate.

lsetiawan added a commit to leewujung/echopype that referenced this issue Feb 20, 2024
Use full lower case to ignore the word 'SOOP' as mentioned in codespell-project/codespell#2375
leewujung added a commit to OSOceanAcoustics/echopype that referenced this issue Feb 26, 2024
* add roadmap update: standardization

* update roadmap: all remaining sections

* update contributors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add SOOP to codespell

* add workflow fig

* separate out acknowledgement

* change roadmap to smallcase

* add exclude word to codespell

* move -L to the front

* ci: Update SOOP ignore using lowercase

Use full lower case to ignore the word 'SOOP' as mentioned in codespell-project/codespell#2375

* update copyright to 2024

* fix typos, small tweaks

* add sponsor logos

* fix image links/size

for more information, see https://pre-commit.ci

* make logos smaller

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Don Setiawan <[email protected]>
apdavison added a commit to openMetadataInitiative/openMINDS_instances that referenced this issue Apr 19, 2024
apdavison added a commit to openMetadataInitiative/openMINDS_instances that referenced this issue Apr 19, 2024
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

9 participants