-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add codespell to test contributed here materials against typos, and fix some typos #103
Add codespell to test contributed here materials against typos, and fix some typos #103
Conversation
=== Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
@neuroinformatics-unit/neuroinformatics-all this looks nice, shall we add it to the cookiecutter template itself (and by extension, other repos)? |
I'm in favour of it. We are already using it on some of our other repos anyway. |
Happy with it too. |
Just FYI: ARC colleagues recommend their usage but agreed not to add it to their cookiecutter template, due to false positives and it sometimes breaking their code. I have no experience using it as a pre-commit though. |
FWIW it is always a good practice to review pre-commit's changes. But indeed in case of a "heavy" pre-commit changes (black etc) it might be tricky... but in this case it doesn't even apply since codespell pre-commit hook by default is just a checker, not a writer (need to pass `-w` option to make that happen)❯ echo Installating >> README.md
changes on filesystem:
README.md | 1 +
❯ git commit -m 'Adding a typo' -a
check docstring is first.............................(no files to check)Skipped
check that executables have shebangs.................(no files to check)Skipped
check for merge conflicts................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
fix requirements.txt.................................(no files to check)Skipped
trim trailing whitespace.................................................Passed
ruff.................................................(no files to check)Skipped
black................................................(no files to check)Skipped
codespell................................................................Failed
- hook id: codespell
- exit code: 65
README.md:308: Installating ==> Installing
❯ git commit -m 'Adding a typo' -a
check docstring is first.............................(no files to check)Skipped
check that executables have shebangs.................(no files to check)Skipped
check for merge conflicts................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
fix requirements.txt.................................(no files to check)Skipped
trim trailing whitespace.................................................Passed
ruff.................................................(no files to check)Skipped
black................................................(no files to check)Skipped
codespell................................................................Failed
- hook id: codespell
- exit code: 65
README.md:308: Installating ==> Installing
so the worst effect from false-positive - inability to commit until white-listing that particular hit one way or another. |
Thanks @yarikoptic. I'll raise a seperate PR to make it part of the template itself. |
Description
Fix and prevent future common typos using https://github.com/codespell-project/codespell
Let me know if you want to add support for codespell into the template
Why is this PR needed?
Typos are there and more might sneak in
What does this PR do?
adds pre-commit and github workflow (let me know if I should remove) and fixes some typos
Checklist: