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 typos as spell checker #641

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

zyf722
Copy link
Contributor

@zyf722 zyf722 commented Oct 25, 2024

What type of PR is this? (check all applicable)

  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • ♻️ Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert
  • 🌐 Internationalization / Translation

Description

This PR adds crate-io/typos as spell checker in CI process.

Spell errors will cause the CI to fail, with errors reported in the Annotations part of GitHub Actions workflow runs (link to this run):

Its behavior can be controlled with the typos.toml file, with config specifications detailed here.

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentations?

  • πŸ““ docs (./docs)
  • πŸ“• storybook (./storybook)
  • πŸ“œ README.md
  • πŸ™… no documentation needed

Copy link

netlify bot commented Oct 25, 2024

βœ… Deploy Preview for livecodes ready!

Name Link
πŸ”¨ Latest commit b253888
πŸ” Latest deploy log https://app.netlify.com/sites/livecodes/deploys/67477c00f20e3a0009a07b0d
😎 Deploy Preview https://deploy-preview-641--livecodes.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

sonarcloud bot commented Oct 25, 2024

@hatemhosny
Copy link
Collaborator

Thanks @zyf722

That is nice.

Is there an easy way to run the test locally? e.g. npm package. This can allow us to reproduce problems locally without having to keep pushing to GitHub to see results.
I know there is a vscode extension (which is convenient during authoring) but I'm not sure we can use it to run over the whole code base.

How about cspell? Also has a vscode extension which seems to be very popular. I'm actually using it.
(I know I slipped a few spelling mistakes, but I was not enforcing it with a test! πŸ˜…)

@zyf722
Copy link
Contributor Author

zyf722 commented Oct 26, 2024

Is there an easy way to run the test locally? e.g. npm package. This can allow us to reproduce problems locally without having to keep pushing to GitHub to see results.

typos is written in Rust, and as far as I know, there is no official npm package for typos. Instead, you can either manually download pre-built binaries from the GitHub release or install it via cargo, brew, conda, or pacman.

You might also be interested in their pre-commit hook.

How about cspell? It also has a VSCode extension which seems to be very popular. I'm actually using it.

It's new to me. I will check it out and see if it fits our needs better :)

I was not enforcing it with a test! πŸ˜…

Indeed, actually I guess we might be faced with false positives in some cases.

Perhaps it would be better to only throw warning annotations when typos are detected, rather than error annotations and terminate the workflow?

@hatemhosny
Copy link
Collaborator

Indeed, actually I guess we might be faced with false positives in some cases.

Actually, cspell does have some false positives in my experience with it.

Perhaps it would be better to only throw warning annotations when typos are detected, rather than error annotations and terminate the workflow?

I agree.

Copy link

sonarcloud bot commented Nov 27, 2024

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