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 doesn't ignore files in .gitignore #34

Open
mr-cal opened this issue Feb 17, 2023 · 3 comments
Open

codespell doesn't ignore files in .gitignore #34

mr-cal opened this issue Feb 17, 2023 · 3 comments
Labels

Comments

@mr-cal
Copy link
Contributor

mr-cal commented Feb 17, 2023

Here's a reproducer:

> python3 -m venv venv
> tox

lint-codespell: commands[0]> codespell --toml /home/developer/dev/starbase/pyproject.toml
./venv/lib/python3.10/site-packages/tox/tox_env/python/api.py:53: interpeter ==> interpreter
./venv/lib/python3.10/site-packages/pip/_internal/vcs/bazaar.py:64: readd ==> re-add, read
./venv/lib/python3.10/site-packages/pip/_internal/vcs/subversion.py:90: readd ==> re-add, read
./venv/lib/python3.10/site-packages/pip/_internal/utils/misc.py:340: becouse ==> because
...

Assuming it will be an easy fix, but I've hit my mental quota for linting issue today.

@lengau lengau added the blocked label Feb 17, 2023
@lengau
Copy link
Contributor

lengau commented Feb 17, 2023

It looks like this is blocked by codespell-project/codespell#1887

I tried a workaround of feeding it the output of git ls-files, but the result in the snapcraft repo was that files that had been skipped previously were no longer skipped since they'd been explicitly added on the command line. Another option would be to filter the output of git ls-files, but that would also be reduplicating the skip configuration, and at minimum we'd probably want a comment in pyproject.toml about not using skip. I think for now it's best to just add anything extra we want to the skip parameter.

Leaving open for further discussion and marking as blocked since the "full"/straightforward fix is blocked from upstream. If we decide to do a full workaround with filtering the output of git ls-files we should probably put it as an answer in the upstream bug too.

@mr-cal
Copy link
Contributor Author

mr-cal commented Feb 17, 2023

I think for now it's best to just add anything extra we want to the skip parameter.

Agreed, that seems like the best workaround for now!

@setharnold
Copy link

setharnold commented Jun 5, 2023

A friend maintains a GitHub action to check spelling; I understand it's built around git ls-files as a starting point, so it might already have the feature you're after: https://github.com/marketplace/actions/check-spelling

The MIR team has been trialing check-spelling ( canonical/ubuntu-mir#19 ).

Edit: Here's an example of check-spelling in the wild, microsoft/terminal#15107 (comment)

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

3 participants