chore: fix comment formatting and typos across codebase#4581
chore: fix comment formatting and typos across codebase#4581criciss wants to merge 1 commit intozeta-chain:mainfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughDocumentation updates clarify ChangesDocumentation and Error Message Formatting
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| // If the observation is successful, the difference between zeta burned | ||
| // and minted is minted by the bank module and deposited into the module | ||
| // and minted by the bank module and deposited into the module | ||
| // account. |
There was a problem hiding this comment.
Incomplete sentence after removing "is minted"
The edit removed is minted to avoid the awkward repetition, but the resulting sentence now lacks a main verb — "the difference between zeta burned and minted by the bank module and deposited into the module account" is a noun phrase with no predicate. Consider restoring the verb with a cleaner rewrite.
| // If the observation is successful, the difference between zeta burned | |
| // and minted is minted by the bank module and deposited into the module | |
| // and minted by the bank module and deposited into the module | |
| // account. | |
| // If the observation is successful, the difference between zeta burned | |
| // and minted is deposited into the module | |
| // account by the bank module. |
Prompt To Fix With AI
This is a comment left during a code review.
Path: x/crosschain/keeper/msg_server_vote_outbound.go
Line: 28-30
Comment:
**Incomplete sentence after removing "is minted"**
The edit removed `is minted` to avoid the awkward repetition, but the resulting sentence now lacks a main verb — "the difference between zeta burned and minted by the bank module and deposited into the module account" is a noun phrase with no predicate. Consider restoring the verb with a cleaner rewrite.
```suggestion
// If the observation is successful, the difference between zeta burned
// and minted is deposited into the module
// account by the bank module.
```
How can I resolve this? If you propose a fix, please make it concise.| // BalanceOfZRC20 queries an account's balance for a given ZRC20 contract | ||
| func (k Keeper) BalanceOfZRC4( |
There was a problem hiding this comment.
Godoc comment name doesn't match function name
Go's convention is that a doc comment must begin with the exact name of the symbol it documents so that go doc and IDEs can associate it correctly. Changing the comment to BalanceOfZRC20 while the function is still named BalanceOfZRC4 creates a mismatch — the same issue exists one function below for TotalSupplyZRC4 (comment now reads TotalSupplyZRC20). Either revert the comment names to match the functions, or rename the functions themselves.
| // BalanceOfZRC20 queries an account's balance for a given ZRC20 contract | |
| func (k Keeper) BalanceOfZRC4( | |
| // BalanceOfZRC4 queries an account's balance for a given ZRC20 contract | |
| func (k Keeper) BalanceOfZRC4( |
Prompt To Fix With AI
This is a comment left during a code review.
Path: x/fungible/keeper/evm.go
Line: 622-623
Comment:
**Godoc comment name doesn't match function name**
Go's convention is that a doc comment must begin with the exact name of the symbol it documents so that `go doc` and IDEs can associate it correctly. Changing the comment to `BalanceOfZRC20` while the function is still named `BalanceOfZRC4` creates a mismatch — the same issue exists one function below for `TotalSupplyZRC4` (comment now reads `TotalSupplyZRC20`). Either revert the comment names to match the functions, or rename the functions themselves.
```suggestion
// BalanceOfZRC4 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(
```
How can I resolve this? If you propose a fix, please make it concise.| } | ||
|
|
||
| // DepositZRC20 deposits ZRC4 tokens into to account; | ||
| // DepositZRC20 deposits ZRC20 tokens into to account; |
There was a problem hiding this comment.
Missed typo: "into to" should be "into an"
The PR fixed a similar "and" → "an" typo in DepositZeta but left DepositZRC20 with the same malformed phrase.
| // DepositZRC20 deposits ZRC20 tokens into to account; | |
| // DepositZRC20 deposits ZRC20 tokens into an account; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: x/fungible/keeper/evm.go
Line: 245
Comment:
**Missed typo: "into to" should be "into an"**
The PR fixed a similar "and" → "an" typo in `DepositZeta` but left `DepositZRC20` with the same malformed phrase.
```suggestion
// DepositZRC20 deposits ZRC20 tokens into an account;
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@x/fungible/keeper/evm.go`:
- Line 245: Update the comment for the DepositZRC20 function to fix the
grammar/typo ("into to account"); change it to a clear phrase such as
"DepositZRC20 deposits ZRC20 tokens into an account" or "DepositZRC20 deposits
ZRC20 tokens into the account" by editing the comment above the DepositZRC20
declaration so it reads correctly and matches surrounding comment style.
- Around line 650-651: The doc comment above the function is inconsistent: it
references "TotalSupplyZRC20" while the function is named TotalSupplyZRC4;
update the comment to match the function name by changing the comment to
"TotalSupplyZRC4 queries the total supply of a given ZRC4 contract" (or, if you
intend to standardize on ZRC20 instead, rename the function to TotalSupplyZRC20
and update all references accordingly); ensure the function signature
TotalSupplyZRC4 and any associated tests/docs use the same name to keep comments
and code aligned.
- Around line 622-623: Update the doc comment to match the function name: change
the opening comment from "BalanceOfZRC20 queries an account's balance for a
given ZRC20 contract" to "BalanceOfZRC4 queries an account's balance for a given
ZRC4 contract" (or otherwise replace ZRC20 with ZRC4) so the comment aligns with
the function BalanceOfZRC4; do not rename the function in this PR to avoid a
breaking change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f47c00c1-fecf-4d23-96b5-edb991e6f58f
📒 Files selected for processing (3)
x/crosschain/keeper/gas_payment.gox/crosschain/keeper/msg_server_vote_outbound.gox/fungible/keeper/evm.go
| } | ||
|
|
||
| // DepositZRC20 deposits ZRC4 tokens into to account; | ||
| // DepositZRC20 deposits ZRC20 tokens into to account; |
There was a problem hiding this comment.
Fix grammatical error in comment.
The comment contains a typo: "into to account" should be "into an account" or simply "into the account".
✏️ Proposed fix
-// DepositZRC20 deposits ZRC20 tokens into to account;
+// DepositZRC20 deposits ZRC20 tokens into an account;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // DepositZRC20 deposits ZRC20 tokens into to account; | |
| // DepositZRC20 deposits ZRC20 tokens into an account; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@x/fungible/keeper/evm.go` at line 245, Update the comment for the
DepositZRC20 function to fix the grammar/typo ("into to account"); change it to
a clear phrase such as "DepositZRC20 deposits ZRC20 tokens into an account" or
"DepositZRC20 deposits ZRC20 tokens into the account" by editing the comment
above the DepositZRC20 declaration so it reads correctly and matches surrounding
comment style.
| // BalanceOfZRC20 queries an account's balance for a given ZRC20 contract | ||
| func (k Keeper) BalanceOfZRC4( |
There was a problem hiding this comment.
Comment/function name mismatch.
The comment describes "BalanceOfZRC20" but the function is named BalanceOfZRC4. This inconsistency may confuse readers. Either update the comment to match the function name, or if "ZRC4" is a legacy naming issue, consider updating the function name to BalanceOfZRC20 (though that would be a breaking change beyond the scope of this PR).
📝 Proposed fix to align comment with function name
-// BalanceOfZRC20 queries an account's balance for a given ZRC20 contract
+// BalanceOfZRC4 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // BalanceOfZRC20 queries an account's balance for a given ZRC20 contract | |
| func (k Keeper) BalanceOfZRC4( | |
| // BalanceOfZRC4 queries an account's balance for a given ZRC20 contract | |
| func (k Keeper) BalanceOfZRC4( |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@x/fungible/keeper/evm.go` around lines 622 - 623, Update the doc comment to
match the function name: change the opening comment from "BalanceOfZRC20 queries
an account's balance for a given ZRC20 contract" to "BalanceOfZRC4 queries an
account's balance for a given ZRC4 contract" (or otherwise replace ZRC20 with
ZRC4) so the comment aligns with the function BalanceOfZRC4; do not rename the
function in this PR to avoid a breaking change.
| // TotalSupplyZRC20 queries the total supply of a given ZRC20 contract | ||
| func (k Keeper) TotalSupplyZRC4( |
There was a problem hiding this comment.
Comment/function name mismatch.
The comment describes "TotalSupplyZRC20" but the function is named TotalSupplyZRC4. This inconsistency may confuse readers. Either update the comment to match the function name, or if "ZRC4" is a legacy naming issue, consider updating the function name to TotalSupplyZRC20 (though that would be a breaking change beyond the scope of this PR).
📝 Proposed fix to align comment with function name
-// TotalSupplyZRC20 queries the total supply of a given ZRC20 contract
+// TotalSupplyZRC4 queries the total supply of a given ZRC20 contract
func (k Keeper) TotalSupplyZRC4(📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // TotalSupplyZRC20 queries the total supply of a given ZRC20 contract | |
| func (k Keeper) TotalSupplyZRC4( | |
| // TotalSupplyZRC4 queries the total supply of a given ZRC20 contract | |
| func (k Keeper) TotalSupplyZRC4( |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@x/fungible/keeper/evm.go` around lines 650 - 651, The doc comment above the
function is inconsistent: it references "TotalSupplyZRC20" while the function is
named TotalSupplyZRC4; update the comment to match the function name by changing
the comment to "TotalSupplyZRC4 queries the total supply of a given ZRC4
contract" (or, if you intend to standardize on ZRC20 instead, rename the
function to TotalSupplyZRC20 and update all references accordingly); ensure the
function signature TotalSupplyZRC4 and any associated tests/docs use the same
name to keep comments and code aligned.
Signed-off-by: criciss <cricis@msn.com>
Description
fix comment formatting and typos across codebase
How Has This Been Tested?
Greptile Summary
This PR makes comment-only fixes across three files — correcting duplicate words, extra spaces before commas, "ZRC4" → "ZRC20" label references, and minor grammar. No functional code is changed.
VoteOutbounddoc comment inmsg_server_vote_outbound.gonow reads as an incomplete sentence (missing verb) afteris mintedwas removed.BalanceOfZRC4andTotalSupplyZRC4inevm.gohave their godoc lines updated to referenceZRC20while the function names still sayZRC4, violating Go's naming convention for doc comments.\"into to account\"typo inDepositZRC20's comment was not fixed despite a similar fix being made inDepositZeta.Confidence Score: 4/5
Safe to merge — comment-only changes with no functional impact, minor remaining comment quality issues.
All changes are cosmetic (comments only), so there is zero risk of runtime regression. The score is held to 4 rather than 5 due to three P2 comment-quality issues introduced or missed by this PR: an incomplete sentence, a godoc name mismatch, and an unfixed typo.
x/fungible/keeper/evm.go (godoc name mismatch for BalanceOfZRC4/TotalSupplyZRC4, missed "into to" typo) and x/crosschain/keeper/msg_server_vote_outbound.go (incomplete sentence)
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[PR: Fix comment formatting & typos] --> B[gas_payment.go] A --> C[msg_server_vote_outbound.go] A --> D[evm.go] B --> B1["✅ 'chain chain id ,' → 'chain id,'"] C --> C1["✅ Punctuation fixes in refundUnusedGas"] C --> C2["⚠️ VoteOutbound doc: removed 'is minted' → incomplete sentence"] D --> D1["✅ 'ZRC4' → 'ZRC20' in DepositZRC20 comment"] D --> D2["✅ 'and account' → 'an account' in DepositZeta"] D --> D3["✅ Trailing space before comma fixes"] D --> D4["✅ 'Marshall' → 'Marshal'"] D --> D5["⚠️ BalanceOfZRC4/TotalSupplyZRC4 godoc names now say 'ZRC20'"] D --> D6["⚠️ 'into to account' typo still present in DepositZRC20"]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "chore: fix comment formatting and typos ..." | Re-trigger Greptile
Summary by CodeRabbit
Documentation
Chores
Note: This release contains internal code improvements with no user-facing changes or new functionality.