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 a spellchecker to GitHub CI #190

Merged
merged 2 commits into from
Sep 4, 2024
Merged

Conversation

ccoVeille
Copy link
Contributor

@ccoVeille ccoVeille commented Sep 4, 2024

This checker won't detect all typos, but will report the obvious ones.

It's a matter of balance. Too much typos, leads to false-positive.
false-positive leads to maintain a list of exception, quite a pain.

Fixes #188

Summary by CodeRabbit

  • New Features
    • Introduced a spell-checking process in the CI workflow to enhance code quality by identifying and correcting typographical errors.
    • Added a configuration file to manage typo checks, focusing on relevant files and excluding specific ones.
  • Bug Fixes
    • Corrected spelling from "Serialisation" to "Serialization" in the HomepageFeatures component for consistency.

Copy link

coderabbitai bot commented Sep 4, 2024

Walkthrough

A new job step has been added to the GitHub Actions workflow configuration in .github/workflows/lint.yaml. This step incorporates a spell-checking action, enhancing the continuous integration process by identifying typographical errors in the codebase. Additionally, a new configuration file .typos.toml has been introduced to manage typo checks, specifying locales and excluded files.

Changes

Files Change Summary
.github/workflows/lint.yaml Added a new job step for spell-checking using crate-ci/[email protected].
.typos.toml Introduced a configuration file for managing typo checks, specifying locale and exclusions.
documentation/src/components/HomepageFeatures/index.tsx Corrected spelling from "Serialisation" to "Serialization".

Assessment against linked issues

Objective Addressed Explanation
Add a CI for detecting typos (#188)

🐰 In the code where the typos may hide,
A spellchecker now stands by our side.
With each little word, we'll catch and correct,
Ensuring our code is polished and perfect!
Hooray for the changes, let errors take flight,
For a cleaner codebase, we now shine bright! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Collaborator

@dylanhitt dylanhitt left a comment

Choose a reason for hiding this comment

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

Any chance to incorporate this into the Makefile as well? If not no worries.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 40840eb and a658376.

Files selected for processing (1)
  • .github/workflows/lint.yaml (1 hunks)

Comment on lines +20 to +22

- name: typos-action spellchecker
uses: crate-ci/[email protected]
Copy link

@coderabbitai coderabbitai bot Sep 4, 2024

Choose a reason for hiding this comment

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

Configure the spellchecker to minimize false positives.

The addition of the spellchecker step aligns with the PR objectives of catching obvious typos in the codebase. Good job!

However, the default settings of the action may not be optimal for the repository and could lead to false positives or missed typos.

Consider configuring the action to minimize false positives and catch relevant typos. For example, you can:

  • Add a custom dictionary file to allow project-specific terms and acronyms.
  • Specify the file types to check for typos.
  • Adjust the threshold for the number of allowed typos.

You can refer to the action's documentation for more configuration options: https://github.com/crate-ci/typos#configuration

Let me know if you would like assistance in configuring the action.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are a good bot

I was thinking about it

Copy link

Choose a reason for hiding this comment

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

@ccoVeille Thank you for the kind words! 😊 I'm glad to hear that you were already thinking about configuring the spellchecker. If you need any help with the configuration or have any specific requirements in mind, feel free to reach out. I'm here to assist!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link

Choose a reason for hiding this comment

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

@ccoVeille Great! Thanks for taking care of the configuration. If you'd like me to review the changes or if there's anything else you need help with, just let me know. 😊

This checker won't detect all typos, but will report the obvious ones.

It's a matter of balance. Too much typos, leads to false-positive.
false-positive leads to maintain a list of exception, quite a pain.

Fixes go-fuego#188
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a658376 and 9a609c5.

Files selected for processing (3)
  • .github/workflows/lint.yaml (2 hunks)
  • .typos.toml (1 hunks)
  • documentation/src/components/HomepageFeatures/index.tsx (1 hunks)
Files skipped from review due to trivial changes (2)
  • .typos.toml
  • documentation/src/components/HomepageFeatures/index.tsx
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/lint.yaml

@ccoVeille
Copy link
Contributor Author

Any chance to incorporate this into the Makefile as well? If not no worries.

typos is a software to install, unfortunately it's not in go. I wouln't add something like cargo install typos-cli or brew install typos-cli

I can add something about

  • detecting if typos is installed reports if not, but do not fail the linting
  • launch it if present

But I would address this in another PR

Copy link
Collaborator

@dylanhitt dylanhitt left a comment

Choose a reason for hiding this comment

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

Thank you 😄

@dylanhitt dylanhitt merged commit 38b8864 into go-fuego:main Sep 4, 2024
5 checks passed
@ccoVeille ccoVeille deleted the ci-typos branch September 4, 2024 16:43
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.

Add a CI for detecting typos
2 participants