-
Notifications
You must be signed in to change notification settings - Fork 32
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 pre-commit configuration #489
Conversation
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.
Thanks for your interest in helping with this!
Please also fix all the issues reported by the check, by doing some mix of the following:
- correcting typos
- adding configuration in
pyproject.toml
to ignore terms that shouldn't be treated as typos (following the example linked from [ci] add codespell #488)
…d the issues identified by codespell
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Thanks! Please see the next round of suggestions.
pyproject.toml
Outdated
[tool.codespell] | ||
# note: pre-commit passes explicit lists of files here, which this skip file list doesn't override - | ||
# this is only to allow you to run codespell interactively | ||
skip = "./.git,./build,./python/_skbuild/,.*egg-info.*,./.mypy_cache,./pyproject.toml,./benchmarks/utilities/cxxopts.hpp" |
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.
skip = "./.git,./build,./python/_skbuild/,.*egg-info.*,./.mypy_cache,./pyproject.toml,./benchmarks/utilities/cxxopts.hpp" | |
skip = "./.git,./build,./.mypy_cache,./pyproject.toml" |
This project doesn't have some of these paths... I'm guessing that maybe you just copied this from another repo. Let's please keep it limited to directory that appear in this project.
pyproject.toml
Outdated
@@ -18,6 +18,16 @@ select = [ | |||
"B" | |||
] | |||
|
|||
[tool.codespell] |
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.
Please move this tool.codespell
table to the head of the file, to preserve alphabetical ordering (by table name). This makes it a little easier to navigate the file as it gets bigger.
pyproject.toml
Outdated
skip = "./.git,./build,./python/_skbuild/,.*egg-info.*,./.mypy_cache,./pyproject.toml,./benchmarks/utilities/cxxopts.hpp" | ||
# ignore short words, and typename parameters like OffsetT | ||
ignore-regex = "\\b(.{1,4}|[A-Z]\\w*T)\\b" | ||
ignore-words-list = "thirdparty,couldn" |
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.
ignore-words-list = "thirdparty,couldn" |
I don't see either thirdparty
or couldn
in the typos found by codespell
... is this necessary? If it's not, please remove it.
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.
Thanks for working through this, looks great! And I'm happy that it caught so many issues.
In the future when you contribute to projects on GitHub, I think you'll find that using a specific-to-one-pull-request branch on your fork, not As soon as I merge this, all of your commits on this PR will be squashed into a single one on |
Resolves #488
I have added the code for codespell in the .pre-commit-config.yaml file. Tested the results locally after adding codespell using
pre-commit run --all-files
and here is the output:It can be seen from the results that codespell have successfully identified the spelling mistakes from the files.