-
Notifications
You must be signed in to change notification settings - Fork 915
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 as a linter #12097
Add codespell as a linter #12097
Conversation
This adds codespell as a linter to the pre-commit config, and fixes various spelling errors it identifies (https://github.com/codespell-project/codespell)
setup.cfg
Outdated
|
||
[codespell] | ||
skip = ./.git,./.github,./cpp/build,.*egg-info.*,versioneer.py,./.mypy_cache,./cpp/tests,./python/cudf/cudf/tests | ||
ignore-words-list = inout,indext,offsett,dout,unparseable,incase,afterall,fiter,trings |
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.
This list is not that long! 💯
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.
I'm cheating a bit and ignoring the tests =)
(The tests have some test data in there that was messing it up - but wasn't really typos)
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.
I think that’s reasonable. We can always expand later if we wish. The errors fixed in this PR are worthwhile even if not covering the whole repo.
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.
You probably could add ./java/src/test
to this list and then remove trings
And add ./cpp/include/cudf_test/cxxopts.hpp
and then remove fiter
.
I'm not finding indext
or afterall
in the code.
Is offsett
in here because of offsetted
? Maybe those can be corrected.
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.
Also, should the skip
list include ./python/cudf/_skbuild
and ./python/strings_udf/_skbuild
as well?
How about __pycache__
?
Is there any way this could use the .gitignore
files so we do not have to maintain both?
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.
I believe cxxopts.hpp
is vendored and that file should be ignored rather than edited. I believe that specific name fiter
is supposed to mean “format iterator” and is not a typo.
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.
Then it should not be linted at all.
If you look at the history for cxxopts.hpp
it has been modified it several times.
I realize fiter
is not a typo but it seems odd to create an exception for it for the entire repo.
Either we should not lint this file or we should fix 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.
I agree with David that we should not lint this file. (My previous comment may have been unclear.)
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.
I've removed the cxxopts.hpp from linting - and applied @wence- suggestion about the ignore regex to exclude template params types. The ignore-words list is down to just inout,unparseable
now, and I think those are both valid words myself.
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.
Perfect! That's ideal.
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.
Nice @benfred! I'd support including this hook.
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.
Love this code spell linter addition ❤️
ok to test |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## branch-23.02 #12097 +/- ##
===============================================
Coverage ? 88.24%
===============================================
Files ? 137
Lines ? 22586
Branches ? 0
===============================================
Hits ? 19931
Misses ? 2655
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Yes, thanks!
* use ignore-regex to exclude template params like OffsetT * slim down list of ignore-words to just inout/unparseable * exclude ./cpp/include/cudf_test/cxxopts.hpp
@gpucibot merge |
rerun tests |
I changed (and reset) the target branch so that the Branch Checker CI would be unblocked. It looks like CI will need to re-run, then this can be merged. |
@gpucibot merge |
rerun tests |
OMG I can't know why I've made that typo. I swear that I stared at that comment many times before merging 😂 |
Exclude the changelog from the pre-commit changelog - this is to prevent CI failures after release when the changelog is updated, as suggested here rapidsai/cudf#12097 (review) This also exports the `__version__` for pylibraft / raft_dask, which was missing previously
Exclude the changelog from the pre-commit codespell check- this is to prevent CI failures after release when the changelog is updated, as suggested here rapidsai/cudf#12097 (review) This also exports the `__version__` for pylibraft / raft_dask, which was missing previously Authors: - Ben Frederickson (https://github.com/benfred) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: #1083
Similar to rapidsai/cudf#12097, this adds codespell as a linter to the pre-commit config, and fixes various spelling errors it highlights. (https://github.com/codespell-project/codespell)
Similar to rapidsai/cudf#12097, this adds codespell as a linter to the pre-commit config, and fixes various spelling errors it highlights. (https://github.com/codespell-project/codespell)
Similar to rapidsai/cudf#12097, this adds codespell as a linter to the pre-commit config, and fixes various spelling errors it highlights. (https://github.com/codespell-project/codespell) Authors: - Ben Frederickson (https://github.com/benfred) Approvers: - Carl Simon Adorf (https://github.com/csadorf) - William Hicks (https://github.com/wphicks) - Joseph (https://github.com/jolorunyomi) - Vyas Ramasubramani (https://github.com/vyasr) URL: #5265
Following the example of rapidsai/cudf#12097, this PR adds [codespell](https://github.com/codespell-project/codespell) as a linter for rmm. Note: I have not included a section in the CONTRIBUTING.md about how to use this (as was done in cudf's PR) because I plan to overhaul the contributing guides for all RAPIDS repos in the near term, and have a single source in docs.rapids.ai with common information about linters used in RAPIDS. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Rong Ou (https://github.com/rongou) - Ben Frederickson (https://github.com/benfred) - Mark Harris (https://github.com/harrism) URL: #1231
Following the example of rapidsai/cudf#12097, this PR adds [codespell](https://github.com/codespell-project/codespell) as a linter for cuspatial. Note: I have not included a section in the CONTRIBUTING.md about how to use this (as was done in cudf's PR) because I plan to overhaul the contributing guides for all RAPIDS repos in the near term, and have a single source in docs.rapids.ai with common information about linters used in RAPIDS. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Mark Harris (https://github.com/harrism) - Michael Wang (https://github.com/isVoid) - Ray Douglass (https://github.com/raydouglass) URL: #992
Following the example of rapidsai/cudf#12097, this PR adds [codespell](https://github.com/codespell-project/codespell) as a linter for cuspatial. Note: I have not included a section in the CONTRIBUTING.md about how to use this (as was done in cudf's PR) because I plan to overhaul the contributing guides for all RAPIDS repos in the near term, and have a single source in docs.rapids.ai with common information about linters used in RAPIDS. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Mark Harris (https://github.com/harrism) - Michael Wang (https://github.com/isVoid) - Ray Douglass (https://github.com/raydouglass) URL: rapidsai#992
Description
This adds codespell as a linter to the pre-commit config, and fixes various spelling errors it identifies (https://github.com/codespell-project/codespell)
Checklist