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: fix some comments #1486

Merged
merged 2 commits into from
Aug 27, 2024
Merged

chore: fix some comments #1486

merged 2 commits into from
Aug 27, 2024

Conversation

haouvw
Copy link
Contributor

@haouvw haouvw commented Jun 26, 2024

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

fix some comments

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • Documentation

    • Corrected spelling errors in the Gravity Bridge setup guide.
    • Fixed typos in the commission field description in OpenAPI specification.
  • Chores

    • Fixed typographical errors in comments and print statements in integration tests.

@haouvw haouvw requested a review from a team as a code owner June 26, 2024 07:51
@haouvw haouvw requested review from yihuang and thomas-nguy and removed request for a team June 26, 2024 07:51
Copy link
Contributor

coderabbitai bot commented Jun 26, 2024

Warning

Rate limit exceeded

@haouvw has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 13 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between e5748d0 and d3ce5b3.

Walkthrough

This update focuses on correcting various typographical errors across documentation and code comments without altering any functional aspects of the software. It aims to improve readability and maintainability by standardizing spelling in key terms related to setup guides, API specifications, and test scripts.

Changes

File Path Change Summary
docs/gravity-bridge/dev-setup-guide.md Corrected "succesfully" to "successfully" in setup guide.
docs/static/openapi.yml Fixed "commision" to "commission" in the commission field description.
integration_tests/cosmoscli.py Corrected "commision" to "commission" in a comment within create_validator function.
integration_tests/test_basic.py Fixed "succesfully" to "successfully" in a print statement and assertion message.
integration_tests/test_replay_block.py Corrected "succeds" to "succeeds" in a comment.

Poem

In code and docs, we make amend,
Typos fixed, with care we tend.
"Commission" and "success" now clear to see,
With perfect words, in harmony.
The rabbit’s work, a labor fine,
For code that’s polished, spellings prime. 🌟


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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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
Contributor

@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)
integration_tests/test_replay_block.py (1)

Line range hint 119-119: Use direct comparison instead of Yoda conditions.

Yoda conditions can reduce code readability. It's recommended to use direct comparisons for clarity.

- assert 2 == len(rsp["result"])
+ assert len(rsp["result"]) == 2

Also applies to: 138-138

Tools
Ruff

95-95: Do not assert False (python -O removes these calls), raise AssertionError() (B011)

Replace assert False

integration_tests/test_basic.py (2)

Line range hint 48-48: Optimize the use of string encoding.

Directly use bytes literals for fixed strings instead of encoding them at runtime, which is more efficient.

- data = hashlib.sha256("gov".encode()).digest()[:20]
+ data = hashlib.sha256(b"gov").digest()[:20]

Line range hint 570-570: Replace Yoda conditions with direct comparison for better readability.

Direct comparisons are more readable and conventional in Python.

- assert 0 == contract.caller.query()
+ assert contract.caller.query() == 0

- assert 5 * (10**18) == contract.caller.query()
+ assert contract.caller.query() == 5 * (10**18)

- assert 23828976 == receipt.cumulativeGasUsed
+ assert receipt.cumulativeGasUsed == 23828976

- assert 2000 == contract.caller.balanceOf(recipient)
+ assert contract.caller.balanceOf(recipient) == 2000

- assert "Hello" == contract.caller.greet()
+ assert contract.caller.greet() == "Hello"

- assert "world" == greeter_call_result
+ assert greeter_call_result == "world"

Also applies to: 576-576, 625-625, 685-685, 813-813, 822-822

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1cc2d06 and e5748d0.

Files selected for processing (5)
  • docs/gravity-bridge/dev-setup-guide.md (1 hunks)
  • docs/static/openapi.yml (2 hunks)
  • integration_tests/cosmoscli.py (1 hunks)
  • integration_tests/test_basic.py (2 hunks)
  • integration_tests/test_replay_block.py (1 hunks)
Files skipped from review due to trivial changes (2)
  • docs/static/openapi.yml
  • integration_tests/cosmoscli.py
Additional context used
Ruff
integration_tests/test_replay_block.py

95-95: Do not assert False (python -O removes these calls), raise AssertionError() (B011)

Replace assert False


119-119: Yoda conditions are discouraged, use len(rsp["result"]) == 2 instead (SIM300)

Replace Yoda condition with len(rsp["result"]) == 2


138-138: Yoda conditions are discouraged, use len(rsp["result"]) == 2 instead (SIM300)

Replace Yoda condition with len(rsp["result"]) == 2

integration_tests/test_basic.py

48-48: Unnecessary call to encode as UTF-8 (UP012)

Rewrite as bytes literal


570-570: Yoda conditions are discouraged, use contract.caller.query() == 0 instead (SIM300)

Replace Yoda condition with contract.caller.query() == 0


576-576: Yoda conditions are discouraged, use contract.caller.query() == 5 * (10**18) instead (SIM300)

Replace Yoda condition with contract.caller.query() == 5 * (10**18)


625-625: Yoda conditions are discouraged, use receipt.cumulativeGasUsed == 23828976 instead (SIM300)

Replace Yoda condition with receipt.cumulativeGasUsed == 23828976


685-685: Yoda conditions are discouraged, use contract.caller.balanceOf(recipient) == 2000 instead (SIM300)

Replace Yoda condition with contract.caller.balanceOf(recipient) == 2000


813-813: Yoda conditions are discouraged, use contract.caller.greet() == "Hello" instead (SIM300)

Replace Yoda condition with contract.caller.greet() == "Hello"


822-822: Yoda conditions are discouraged, use greeter_call_result == "world" instead (SIM300)

Replace Yoda condition with greeter_call_result == "world"

LanguageTool
docs/gravity-bridge/dev-setup-guide.md

[uncategorized] ~7-~7: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... ## Prerequisite ### Binaries - geth, the go-ethereum binary. - cronosd, th...


[uncategorized] ~8-~8: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...th, the go-ethereum binary. - cronosd, the cronos node binary. - gorc`, the g...


[uncategorized] ~9-~9: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...onosd, the cronos node binary. - gorc`, the gravity bridge orchestrator cli, bu...


[uncategorized] ~10-~10: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...ronos/orchestrator/gorc). - pystarport, a tool to run local cosmos devnet. - `s...


[grammar] ~26-~26: The verb form ‘embed’ does not seem to be suitable in this context. (HAVE_VB)
Context: ... use a public cronos testnet (that have embed the gravity-bridge module), or run `sta...


[grammar] ~168-~168: Make sure that the noun ‘setup’ is correct. Did you mean the past participle “set up”? (BE_VB_OR_NN)
Context: ...y bridge between ethereum and cronos is setup successfully.

Markdownlint
docs/gravity-bridge/dev-setup-guide.md

164-164: Column: 1 (MD010, no-hard-tabs)
Hard tabs


165-165: Column: 1 (MD010, no-hard-tabs)
Hard tabs


34-34: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


41-41: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


65-65: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


139-139: null (MD014, commands-show-output)
Dollar signs used before commands without showing output


37-37: Punctuation: ':' (MD026, no-trailing-punctuation)
Trailing punctuation in heading


66-66: Punctuation: ':' (MD026, no-trailing-punctuation)
Trailing punctuation in heading


79-79: Punctuation: ':' (MD026, no-trailing-punctuation)
Trailing punctuation in heading


73-73: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines


88-88: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines


92-92: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines


102-102: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines


73-73: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


88-88: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified

integration_tests/test_replay_block.py Outdated Show resolved Hide resolved
docs/gravity-bridge/dev-setup-guide.md Outdated Show resolved Hide resolved
@yihuang
Copy link
Collaborator

yihuang commented Jul 25, 2024

hi, please sign the commit, thanks

@haouvw
Copy link
Contributor Author

haouvw commented Aug 26, 2024

hi, please sign the commit, thanks

Thanks. Signed!

@yihuang yihuang enabled auto-merge August 27, 2024 03:22
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.24%. Comparing base (a1d0242) to head (d3ce5b3).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1486   +/-   ##
=======================================
  Coverage   15.24%   15.24%           
=======================================
  Files          67       67           
  Lines        4874     4874           
=======================================
  Hits          743      743           
  Misses       4037     4037           
  Partials       94       94           

@yihuang yihuang added this pull request to the merge queue Aug 27, 2024
Merged via the queue into crypto-org-chain:main with commit 7a04a82 Aug 27, 2024
42 checks passed
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