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

codespell complains about its ignore-words-list in pyproject.toml #3248

Closed
Borda opened this issue Dec 12, 2023 · 5 comments
Closed

codespell complains about its ignore-words-list in pyproject.toml #3248

Borda opened this issue Dec 12, 2023 · 5 comments

Comments

@Borda
Copy link

Borda commented Dec 12, 2023

Not sure if I am doing something wrong but found it confusing that Codepell is complaining about words from its own configuration...

Running pre-commit with

  - repo: https://github.com/codespell-project/codespell
    rev: v2.2.6
    hooks:
      - id: codespell
        additional_dependencies: [tomli]

and having pyproject config

[tool.codespell]
skip = 'tests/*'
quiet-level = 3
ignore-words-list = "Chang,Manuel"

and getting the following error:

codespell................................................................Failed
- hook id: codespell
- exit code: 65

pyproject.toml:25: Manuel ==> Manual

found it while working on this PR: PyGithub/PyGithub#2858

@peternewman
Copy link
Collaborator

Yes, you're only skipping tests/* so codespell is finding typos in pyproject.toml. Just add it to the skip list if you'd like it to skip checking that file.

@Borda
Copy link
Author

Borda commented Dec 12, 2023

Yes, you're only skipping tests/* so codespell is finding typos in pyproject.toml. Just add it to the skip list if you'd like it to skip checking that file.

yes, that is what I did, but how about if do want to check for typos in pyproject.toml just exclude the definition for codespell... this sounds like is complaining about typos which I told him they are allowed which is strange

@DimitriPapadopoulos
Copy link
Collaborator

I believe that's because the ignore list is incorrect. Try:

ignore-words-list = "chang,manuel"

instead of:

ignore-words-list = "Chang,Manuel"

Does it work any better? See #3210 for an in-depth explanation.

@peternewman
Copy link
Collaborator

Oops, well spotted @DimitriPapadopoulos ! Of course if the word was correctly in the list, it wouldn't trigger in any file.

@Borda
Copy link
Author

Borda commented Dec 12, 2023

Ohh, cases... yes, that works, which brings me to another tricky part; for example, for "Manuel" with a capital M it is likely a name, but with a small m, it is likely typo... also the same for abbreviations; when they are with the capital they are meant to be such way, but small cases are likely typos

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

No branches or pull requests

3 participants