Skip to content

CLAUDE.md: scope the no-named-returns rule to implementations - #245

Open
thedavidmeister wants to merge 1 commit into
mainfrom
2026-09-21-issue-116-named-returns-scope
Open

thedavidmeister wants to merge 1 commit into
mainfrom
2026-09-21-issue-116-named-returns-scope

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Closes #116

- No named return values. was stated flat, in a conventions list whose sibling
bullets explicitly govern interfaces. src/interface/ICloneableV2.sol:50 is

function initialize(bytes calldata data) external returns (bytes32 success);

the only named return component in all of src/ and test/. A session reading
the bullet either "fixes" a current published declaration, changing its ABI
output names and forcing a republish for consumers, or learns that the
conventions list is unreliable.

Every returns in the repo with a body behind it is unnamed — the library's
nine, the six test concretes', the test contracts' — so the rule is true of
implementations, and the case it never scoped is the declaration, where a name
is documentation rather than a local variable. That is the property the bullet
now carries, rather than an exception list naming one file.

The road not taken. The issue's pass4 member proposes the other resolution:
drop success from the declaration and the now-dangling name token from its
@return tag, leaving the bullet flat. That is a one-token change to a
published interface, and correctness over consumer compatibility would favour
it. It is not taken here because src/interface/ICloneableV2.sol belongs to a
different batch of this audit (#150 rewrites its NatSpec) and two branches must
not edit one file. If you prefer that direction, this is the PR to drop.

CLAUDE.md is 3826 bytes on this branch against the 4096 agent-context-cap
(3807 on main).

QA

  • Discriminating tests: n/a — CLAUDE.md is process documentation, and tests
    never assert doc text. Pinning declaration names in a test is also an ABI
    snapshot, which is ruled out.
  • Mutations applied: n/a — no src/ or test/ code changed.
  • Oracle: every returns declaration in src/ and test/, enumerated —
    one named, the rest unnamed.
  • Category check: swept the other flat bullets in the same conventions list
    against the tree. Versions, compiler settings and the Soldeer bullet all hold
    as written; this was the only one with a counterexample in the repo.

🤖 Generated with Claude Code

`ICloneableV2.initialize` declares `returns (bytes32 success)`. Every `returns`
with a body behind it is unnamed, so the rule holds for implementations and it is
the declaration case it never scoped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6ea41565-b66a-439d-b45e-db548fbc3adc

📥 Commits

Reviewing files that changed from the base of the PR and between 710dff5 and 8df5e38.

📒 Files selected for processing (1)
  • CLAUDE.md

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

[F12] [LOW] CLAUDE.md's "No named return values" is contradicted by the current ICloneableV2 interface

1 participant