Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ reviews:
- Confirm that the code meets the project's requirements and objectives
- Confirm that copyright years are up-to date whenever a file is changed
- Point out redundant obvious comments that do not add clarity to the code
- Ensure that comments are concise and suggest more concise comment statements if possible
- Discourage usage of verbose comment styles such as NatSpec

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

NatSpec Solidity official documentation style guide best practices

💡 Result:

Solidity NatSpec (official docs) — style + best practices

  • Document all public/external ABI surfaces (recommended: “fully annotated” for everything in the ABI). [1]
  • Use NatSpec comment syntax directly above the item being documented: triple-slash /// (single or multi-line) or block /** ... */. [1][2]
  • Choose tags based on audience:
    • @notice: end-user facing description (may be shown at signing time). [1]
    • @dev: developer-focused details. [1]
  • Tag rules / mechanics
    • If you write a NatSpec comment with /// or /** ... */ and no tags, the compiler treats it as @notice. [1]
    • The compiler only parses NatSpec tags for public/external functions (you can still comment internal/private, but they won’t be parsed into NatSpec output). [1]
    • @param must be followed by the parameter name; for multiple params, use multiple @param lines. [1]
    • For multiple return values, use multiple @return lines (same pattern as @param). [1]
    • Use @inheritdoc <BaseContract> to copy missing tags from a base function; note inheritance edge cases (e.g., differing param names / multiple bases). [1]
    • For tool-specific annotations, use @custom:<name>; the <name> must be lowercase letters or hyphens and cannot start with a hyphen. [1]

Practical formatting conventions (commonly adopted)

  • Many large codebases standardize on always using @notice, and add blank lines between @notice, @param, and @return blocks for readability (example: OP Stack contracts). [3]

Sources: Solidity NatSpec Format docs [1], Solidity Style Guide (NatSpec section) [2], OP Stack smart contract style guide (NatSpec conventions) [3].


🏁 Script executed:

cat -n .coderabbit.yaml | sed -n '150,170p'

Repository: AOSSIE-Org/OpenVerifiableLLM

Length of output: 1215


🏁 Script executed:

cat -n .coderabbit.yaml | sed -n '220,250p'

Repository: AOSSIE-Org/OpenVerifiableLLM

Length of output: 2297


Global NatSpec discouragement conflicts with Solidity best practices.

NatSpec (Ethereum Natural Language Specification Format) is the standard documentation format for Solidity smart contracts, recommended by the official Solidity Style Guide for all public and external functions. This project already has dedicated Solidity-specific path instructions (lines 223–245). The global instruction at line 161 to discourage NatSpec will cause false-positive review noise on .sol files where @notice, @dev, @param, and @return tags are standard practice.

Consider either:

  1. Scoping the NatSpec discouragement to non-Solidity files via a path-specific instruction, or
  2. Explicitly allowing NatSpec in the Solidity path block.
♻️ Option 1 — Move NatSpec discouragement out of global instructions

Remove line 161 from the global instructions and add it to a new path instruction for non-Solidity files:

    - path: "**/*.{ts,tsx,js,jsx,py,css,html}"
      instructions: |
        - Discourage usage of verbose comment styles such as NatSpec
♻️ Option 2 — Add NatSpec exemption to Solidity path block

Add to the Solidity path instructions (around line 225):

        - NatSpec comments (`@notice`, `@dev`, `@param`, `@return`) are encouraged for all public and external functions.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.coderabbit.yaml at line 161, The global instruction "- Discourage usage of
verbose comment styles such as NatSpec" conflicts with Solidity conventions;
remove this entry from the global instructions and either (A) add it to a new
path-scoped rule targeting non-Solidity files (e.g., path:
"**/*.{ts,tsx,js,jsx,py,css,html}" with the discourage line in its instructions)
or (B) update the existing Solidity path instruction block to explicitly
allow/encourage NatSpec (e.g., add "NatSpec comments (`@notice`, `@dev`, `@param`,
`@return`) are encouraged for all public and external functions") so .sol files
are exempted.

- Look for code duplication
- Suggest code completions when:
- seeing a TODO comment
Expand Down Expand Up @@ -276,3 +278,4 @@ reviews:
- Proper @2x and @3x variants for different screen densities
- SVG assets are optimized
- Font files are licensed and optimized