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 support (config, workflow to detect/not fix) and make it fix few typos #26315
base: main
Are you sure you want to change the base?
Conversation
Please don't touch the changelogs, they match the title used in the corresponding PR, typos and all. |
@@ -262,7 +262,7 @@ conflict of interests include, but are not limited to: | |||
All members of the Council shall disclose to the rest of the Council any | |||
conflict of interest they may have. Members with a conflict of interest | |||
in a particular issue may participate in Council discussions on that | |||
issue, but must recuse themselves from voting on the issue. | |||
issue, but must recurse themselves from voting on the issue. |
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.
not a big fan of a adding automated spell-checking if we'll have to ignore it making mistakes like this...
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.
rright -- I even ran into this particular one before -- recuse
is indeed rare and I failed to spot it in review, sorry about that. I will whitelist it.
Used codespellit list-hits-sorted | sed -n -e '/6 /,9999p' | tac | f2 | tr '\n' ',' to find and sort
…espell + parms -> params
… fp{k} I think it makes them more consistent (always a suffix) and also more readable since more descriptive of the taken action. This is triggered to avoid "looks-like-a-typo" hits in codespell for fpr and likely others
14d5762
to
66941b7
Compare
Thanks for quick feedback @charris and @ngoldbaum ! I
|
=== Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
… automagically but ignoring the failure due to ambigous typos === Do not change lines below === { "chain": [], "cmd": "codespell -w || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
…us typos === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
=== Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
Funny thing is that it does not catch it on 'main' for some reason but catches here... it is likely because python tools/linter.py --branch origin/main works on the diff only (too fast on main) and thus whenever those spaces were introduced, it did not check and never flipped since then. I changed that line, and it was checked and flagged.
66941b7
to
bb7d7f3
Compare
More about codespell: https://github.com/codespell-project/codespell .
I personally introduced it to dozens if not hundreds of projects already and so far only positive feedback.
CI workflow has 'permissions' set only to 'read' so also should be safe.
There were numerous commits where
codespell
was used "manually" to fixup some of the typos.CI: use codespell, flake8 to check code before merging? #13694 still contemplates idea of running
codespell
on PRsAn early attempt to introduce codespell CI was abandoned: BLD: Codespell for NumPy CI #19594 -- IMHO now is better time!
I did
lapack_lite
last in the separate commits if there is desire to not touch it (although I saw commits fixing typos in it as well).I did some variable renames to take them away from "close to a typo" form, might be worth having a look and suggesting alternative names.
I did fix older changelogs as I think there is no point to cherish typos in them, but they could also be ignored.