-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add codespell support (config, workflow to detect/not fix) and make it fix some typos #14454
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
base: main
Are you sure you want to change the base?
Conversation
@yarikoptic - thanks for this, it looks interesting and is something we could possibly adopt. We'd obviously need it to pass CI. My brief take on getting that to happen:
|
Signed-off-by: Yaroslav O. Halchenko <[email protected]>
Signed-off-by: Yaroslav O. Halchenko <[email protected]>
…(but ignoring overall fail due to ambigous ones) === Do not change lines below === { "chain": [], "cmd": "codespell -w || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ Signed-off-by: Yaroslav O. Halchenko <[email protected]>
…os automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w -w -i 3 -C 4", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ Signed-off-by: Yaroslav O. Halchenko <[email protected]>
Signed-off-by: Yaroslav O. Halchenko <[email protected]>
done
do you use any helper for that, e.g. smth like https://www.npmjs.com/package/pin-github-action
it seems that test fails are due to interaction with other components of argo which still carry those typos, like
ATM there is no (easy/built-in) way to skip files based on content (e.g. matching "Code generated by"), could only easily skip based on matching filenames (e.g.
done, there is |
Thanks
No, we just pin manually.
This would require argo-events to be fixed, then a release made, and then us to import that new release in go.mod. (Technically the release could be skipped and we import as a SHA, but for spelling only that feels like it does more harm than good).
If generated files have typos but they're imported typos (e.g. we're embedding a documented struct from another project as we do) we can't fix them. The non-generated file typos should be detected and then the generated files regenerated to be fixed also.
Yes, this must be in the dependencies for pre-commit. In order that this is satisfactory it should get installed, and we do this (somewhat badly) via the Makefile, so that you can spin up a devcontainer and run |
ok, let's then be "sequential" to avoid messing with exclusions etc, and first get done |
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 is some fixes in the code as well, but eyeballing those changes they seems to be kosher... well -- tests should show, right?