Skip to content
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

ci: add codespell #176

Merged
merged 2 commits into from
Jun 7, 2023
Merged

ci: add codespell #176

merged 2 commits into from
Jun 7, 2023

Conversation

roobre
Copy link
Collaborator

@roobre roobre commented Jun 1, 2023

Description

This PR adds the (in my opinion) neat codespell action that checks for and suggest fixes for common spelling mistakes. It also fixes a few of those that codespell already found.

Checklist:

  • My code follows the coding style of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works.
  • Any dependent changes have been merged and published in downstream modules

@roobre roobre marked this pull request as ready for review June 1, 2023 10:18
@pablochacin
Copy link
Collaborator

@roobre I like the idea of automating the spelling checking as we (mostly me) have not been doing a great job there, as you have realized.

However, I'm more in the line of activating the misspelled linter than adding a new action because we already have the linter action, and second, it makes it easier to check and fix locally using the make lint target in the project's makefile.

@roobre
Copy link
Collaborator Author

roobre commented Jun 4, 2023

@pablochacin I'm fine with a different tool, I went with this on a first try because it's the one I'm familiar with.

I'll give the one you suggest a try and go for that unless there is any big drawback w.r.t. codespell. Being able to run it locally is alsoa big plus for me.

@roobre
Copy link
Collaborator Author

roobre commented Jun 6, 2023

@pablochacin I'm giving this a swing but I don't think it's working particularly well. Turns out the misspell linter is, in fact, already enabled as per:

enable-all: true

But it does not seem to be extremely good at doing what it's supposed to do. It does work though, if you input a word from https://github.com/golangci/misspell/blob/master/words.go it will flag it, but coverage does not seem as good as codespell.

I've messed around a bit with the codespell action and it seems possible, while not very elegant, to run it locally with something like:

docker run -v `realpath .`:/disruptor -w /disruptor --entrypoint codespell ghcr.io/codespell-project/actions-codespell/stable:v2 --config .codespellrc

So perhaps a good option here wold be to add this command to a make target or similar.

Copy link
Collaborator

@pablochacin pablochacin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@roobre roobre merged commit 7ad63d6 into main Jun 7, 2023
@roobre roobre deleted the spelling branch June 7, 2023 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants