-
-
Notifications
You must be signed in to change notification settings - Fork 670
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 pre-commit hooks to implement spelling failures before PR is pushed. #5092
Comments
Thank you for contributing an issue! 🙏 Welcome to the ITK community! 🤗👋☀️ We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜 This is an automatic message. Allow for time for the ITK community to be able to read the issue and comment on it. |
Welcome Hans! It must have been years since you last opened an issue. You mostly close them via PRs! Scratch that: you last opened an issue in April. @jhlegarreta what are the conditions for github-actions bot to post this welcome message? |
@dzenanz The action used is this one https://github.com/actions/first-interaction, as-is. Have not investigated the code and is provided by GitHub. |
@dave3d did much too the work for the current spell check system. One downside of the approach is that it relies on a linux package or library that is not easily available across platforms. However, Pixi with conda-forge may help to address this issue if a more portable spell checker can not be used. |
I have found this one useful: https://github.com/codespell-project/codespell |
I looked at that repo. It's a bit strange in that the dictionary contains misspellings and then maps those misspelled words to the correct spellings. But what happens for a misspelling that is not in their dictionary? I found another spell checker that's pure Python: https://pyspellchecker.readthedocs.io/en/latest/ That would avoid the problems my current code has depending on enchant. I could try to use that spell checker instead. |
@dave3d have you seen this discussion on the pyenchant repository, looks like there are solutions to the ARM issue, possibly worth exploring. |
Such misspellings are not caught. The thinking is to greatly reduce false positives. Variable names often have words attached together and thus can trigger a great number of false positives. It's not perfect, but nothing is. :) |
Here's an example of running it on nifti_clib: NIFTI-Imaging/nifti_clib@e3f5a77 |
Description
Small spelling errors are caught (and rejected) by the github actions on PRs, but not during development.
Impact analysis
A small spelling error introduces:
Expected behavior
Enforcement of code requirements should be inline with normal development processes. Fixing these errors at the time they are made is much more efficient use of developer time.
Actual behavior
Developer burden is increased if the PR is made before identifying the spelling issue.
Environment
Development environments.
Additional Information
Possible solution:
https://github.com/codespell-project/codespell
Some GitHub itk infrastructure.
The text was updated successfully, but these errors were encountered: