You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find the codespell tool useful for checking common misspellings (see PR #1057, #2670, and also many PRs in the GMT repository). But we should also be aware that the tool is not perfect and it still generates some false-positives. For examples, after PR #1057, running codespell --skip=.git gives:
Here are my thoughts about how we can use codespell better:
Add "Running codespell --skip=.git to check common misspellings" to the release checklist, so that we can fix some typos before a release
Maintain a list of words that should be ignored by codespell, for example, codespell --skip=.git -L astroid,tripel,trough,oints produces fewer false positives.
Use the codespell GitHub Actions actions-codespell to detect misspellings in PRs
3. Use the codespell GitHub Actions actions-codespell to detect misspellings in PRs
I don't think we should use the codespell GitHub Actions. Here are my reasons:
Misspellings are just very tiny bugs, and they are not worth wasting CI resources.
It still produces many false-positives, especially for ReST/Markdown syntax which uses non-word characters (e.g., *) very often. Enabling spellcheck may distract contributors from their PRs.
Add "Running codespell --skip=.git to check common misspellings" to the release checklist, so that we can fix some typos before a release
Maintain a list of words that should be ignored by codespell, for example, codespell --skip=.git -L astroid,tripel,trough,oints produces fewer false positives.
The good news is that codespell supports pyproject.toml, so we can maintain the list of valid words in pyproject.toml. Before each release, we just need to run codespell once, then we can fix any detected misspellings and also update the word list in pyproject.toml to reduce false-positives.
Activity
michaelgrund commentedon Sep 7, 2023
Sounds good to me to have at least an automatic procedure to detect the most common typos and misspellings.
seisman commentedon Sep 7, 2023
I don't think we should use the codespell GitHub Actions. Here are my reasons:
*) very often. Enabling spellcheck may distract contributors from their PRs.The good news is that codespell supports pyproject.toml, so we can maintain the list of valid words in pyproject.toml. Before each release, we just need to run
codespellonce, then we can fix any detected misspellings and also update the word list inpyproject.tomlto reduce false-positives.