-
Notifications
You must be signed in to change notification settings - Fork 48
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 hook for codespell #307
Open
weiji14
wants to merge
6
commits into
main
Choose a base branch
from
pre-commit/codespell
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Automate typo-finding using [codespell](https://github.com/codespell-project/codespell/tree/v2.3.0?tab=readme-ov-file#pre-commit-hook). Added LINZ to the ignore list as a start.
A couple of words in these legal documents to ignore.
Binary outputs in Jupyter Notebooks are not skipped by codespell, xref codespell-project/codespell#2138. So manually skipping these files after true-positive typos have been fixed.
weiji14
commented
Jul 24, 2024
Comment on lines
+7
to
+11
skip = [ | ||
"docs/clay-v0/tutorial_digital_earth_pacific_patch_level.ipynb", | ||
"docs/clay-v0/partial-inputs.ipynb", | ||
"docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codespell catches some false positive misspellings in Jupyter Notebook binary outputs (see also codespell-project/codespell#2138), so skipping these files after the true positive misspellings have been fixed:
docs/clay-v0/tutorial_digital_earth_pacific_patch_level.ipynb:245: iNH ==> in
docs/clay-v0/tutorial_digital_earth_pacific_patch_level.ipynb:687: te ==> the, be, we, to
docs/clay-v0/tutorial_digital_earth_pacific_patch_level.ipynb:916: WEe ==> we
docs/clay-v0/tutorial_digital_earth_pacific_patch_level.ipynb:985: Nd ==> And, 2nd
docs/clay-v0/tutorial_digital_earth_pacific_patch_level.ipynb:985: FO ==> OF, FOR, TO, DO, GO
docs/clay-v0/tutorial_digital_earth_pacific_patch_level.ipynb:985: OT ==> TO, OF, OR, NOT, IT
docs/clay-v0/tutorial_digital_earth_pacific_patch_level.ipynb:985: bu ==> by, be, but, bug, bun, bud, buy, bum
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: oly ==> only
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: teH ==> the
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: FO ==> OF, FOR, TO, DO, GO
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: tRU ==> through, true
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: AAs ==> ass, as
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: ALo ==> also
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: ALo ==> also
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: ALo ==> also
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: ALo ==> also
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: ALo ==> also
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: ALo ==> also
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: ALo ==> also
docs/tutorials/v1-inference-simsearch-naip-stacchip.ipynb:708: ALo ==> also
docs/clay-v0/partial-inputs.ipynb:394: oT ==> to, of, or, not, it
docs/clay-v0/partial-inputs.ipynb:394: fPr ==> for, far, fps
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Catch misspellings using codespell.
Added a
pyproject.toml
file with a[tool.codespell]
section to configure a list of words to ignore (e.g. LINZ).Original list of typos from https://results.pre-commit.ci/run/github/698210830/1721775297.Gdhue1HnRoC75KjYK2T9Eg (note that there are some false positives from jupyter notebook binary outputs):