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

chore: add spellchecker #65

Merged
merged 1 commit into from
Nov 15, 2024
Merged

chore: add spellchecker #65

merged 1 commit into from
Nov 15, 2024

Conversation

Vritra4
Copy link
Collaborator

@Vritra4 Vritra4 commented Nov 15, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new automated spell-checking workflow for pull requests to improve code quality.
    • Added a list of terms to be ignored by the spell-checking tool, preventing false positives.
  • Bug Fixes

    • Corrected typographical errors in logging messages for better clarity.
    • Fixed field name from Adddress to Address in multiple structures to ensure accuracy.
  • Documentation

    • Updated comments for clarity and correctness in various code sections.

@Vritra4 Vritra4 requested a review from joon9823 November 15, 2024 07:34
Copy link

coderabbitai bot commented Nov 15, 2024

Walkthrough

This pull request introduces multiple changes across various files. Key updates include the addition of new entries in the .codespellignore file to prevent certain terms from being flagged during spell checks, and the creation of a new GitHub Actions workflow (spellcheck.yml) to automate spell checking in pull requests. Additionally, several existing files have undergone minor modifications, mainly correcting typographical errors in logging and struct field names without altering any core functionality.

Changes

File Path Change Summary
.github/config/.codespellignore Added multiple entries: cips, pullrequest, keypair, pastTime, hasTables, Nam, EyT, upTo, initia, minitia, expRes.
.github/workflows/spellcheck.yml Introduced a new workflow for automated spell checking on pull requests.
submodules/evm-nft/collect.go Minor logging correction in handlerTransferEvent: changed "object addres" to "object address".
submodules/move-nft/collect.go Updated logging and error handling in event handling methods; corrected "prev owner and object addres" to "prev owner and object address".
submodules/pair/types/types.go Corrected field name Adddress to Address in MetadataResource struct.
submodules/wasm-pair/types/types.go Corrected field name Adddress to Address in MetadataResource struct.
x/kvindexer/keeper/keeper.go Updated comment in NewKeeper function: changed "unncessary" to "unnecessary".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub
    participant Codespell
    participant PR_Creator

    User->>GitHub: Create Pull Request
    GitHub->>Codespell: Trigger Spell Check
    Codespell->>Codespell: Check for spelling errors
    Codespell->>PR_Creator: Create Pull Request with fixes
    PR_Creator->>User: Notify about spell check results
Loading

🐰 "In the code, we find delight,
With spell checks running day and night.
Errors fixed, our work is neat,
A hopping joy, a coding feat!
With every pull, we make it right,
Hooray for changes, what a sight!" 🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 golangci-lint

level=warning msg="The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar."


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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

@joon9823 joon9823 left a comment

Choose a reason for hiding this comment

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

LGTM

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: 2

🧹 Outside diff range and nitpick comments (3)
.github/workflows/spellcheck.yml (3)

3-5: Consider adding more trigger events

The workflow currently only runs on pull requests. Consider adding triggers for pushes to the main branch to catch typos that might slip through PR reviews.

 on:
   pull_request:
+  push:
+    branches:
+      - main

16-16: Improve maintainability of skip patterns

The skip pattern is complex and hard to maintain. Consider moving it to a configuration file.

Create a new file .github/config/codespell-skip.txt:

*.pulsar.go
*.pb.go
*.pb.gw.go
*.cosmos_orm.go
*.json
*.git
*.js
crypto/keys
fuzz
*.h
proto/tendermint
*.bin
go.sum
go.work.sum
go.mod
statik.go
*.map
swagger.yaml

Then update the command:

-          codespell -w --skip="*.pulsar.go,*.pb.go,*.pb.gw.go,*.cosmos_orm.go,*.json,*.git,*.js,crypto/keys,fuzz,*.h,proto/tendermint,*.bin,go.sum,go.work.sum,go.mod,statik.go,*.map,swagger.yaml" --ignore-words=.github/config/.codespellignore
+          codespell -w --skip-files-from=.github/config/codespell-skip.txt --ignore-words=.github/config/.codespellignore

25-28: Enhance pull request body with more context

The current PR body could be more informative. Consider adding:

  • List of files that were modified
  • Link to the codespell documentation
  • Instructions for reviewing the changes
           body: |
-            This PR fixes typos in the codebase.
-            Please review it, and merge if everything is fine.
-            If there are proto changes, run `make proto-gen` and commit the changes.
+            ## Automated Spell Check Results
+            
+            This PR contains automated fixes for spelling issues detected by [codespell](https://github.com/codespell-project/codespell).
+            
+            ### Review Instructions
+            1. Please verify that the changes are legitimate spelling corrections
+            2. Ensure no code functionality was accidentally altered
+            3. If there are proto changes, run `make proto-gen` and commit the changes
+            
+            ### Modified Files
+            <details>
+            <summary>Click to expand</summary>
+            
+            ```
+            ${CHANGED_FILES}
+            ```
+            </details>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between bf9911a and a8914be.

📒 Files selected for processing (7)
  • .github/config/.codespellignore (1 hunks)
  • .github/workflows/spellcheck.yml (1 hunks)
  • submodules/evm-nft/collect.go (1 hunks)
  • submodules/move-nft/collect.go (1 hunks)
  • submodules/pair/types/types.go (1 hunks)
  • submodules/wasm-pair/types/types.go (1 hunks)
  • x/kvindexer/keeper/keeper.go (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • .github/config/.codespellignore
  • submodules/evm-nft/collect.go
  • x/kvindexer/keeper/keeper.go
🧰 Additional context used
🪛 golangci-lint
submodules/pair/types/types.go

32-32: File is not goimports-ed

(goimports)

submodules/wasm-pair/types/types.go

32-32: File is not goimports-ed

(goimports)

🔇 Additional comments (2)
.github/workflows/spellcheck.yml (1)

16-16: Verify .codespellignore file existence and location

The workflow references .github/config/.codespellignore. Let's ensure this file exists in the correct location.

✅ Verification successful

Codespell configuration is properly set up

The .codespellignore file exists at the expected location .github/config/.codespellignore and contains a valid list of words to be ignored during spell checking. The workflow configuration is correctly referencing this file.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify .codespellignore file exists and check its contents

# Check if the file exists
if [ -f ".github/config/.codespellignore" ]; then
    echo "File exists. Contents:"
    cat ".github/config/.codespellignore"
else
    echo "Warning: .codespellignore file not found at .github/config/.codespellignore"
    # Check if it exists in other common locations
    find . -name ".codespellignore" -type f
fi

Length of output: 216

submodules/move-nft/collect.go (1)

164-164: LGTM: Log message typo fix

The correction of "address" spelling in the log message improves clarity while maintaining the same informative context.

.github/workflows/spellcheck.yml Show resolved Hide resolved
.github/workflows/spellcheck.yml Show resolved Hide resolved
@Vritra4 Vritra4 merged commit 8360f0f into main Nov 15, 2024
6 checks passed
@Vritra4 Vritra4 deleted the chore/spellcheck branch November 22, 2024 05:15
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