Skip to content

refactor: name the agree guard validateAgreeTolerances - #282

Closed
thedavidmeister wants to merge 1 commit into
mainfrom
2026-09-27-rename-validate-agree-tolerances
Closed

thedavidmeister wants to merge 1 commit into
mainfrom
2026-09-27-rename-validate-agree-tolerances

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

agreeValidateTolerances read as "agree validate tolerances".

Its siblings — agreeSpread, agreeAnchor, agreeLimit — are noun phrases
naming what they return, so the agree prefix carries the association and the
rest of the name says what the value is. A verb does not fit that shape and
belongs at the front instead: validateAgreeTolerances reads as English and
still says whose tolerances it validates.

Private, so nothing outside the library refers to it.

QA

  • Discriminating tests: n/a, and none would discriminate. The diff renames a
    private function at its declaration and its single call site. A rename that
    missed either would not compile, which is the check — and it does compile.
    The 33 tests in LibDecimalFloat.agree.t.sol pass unchanged, including the
    four guard tests that would fail if the call site had been dropped rather than
    renamed.
  • Mutations applied: n/a. There is no behaviour to mutate; the only edit is
    an identifier. A mutant would either fail to compile or be the identical
    program.
  • Oracle: the compiler. A private function's name is checked exhaustively at
    build time — an unrenamed reference is an error, and an unreferenced
    declaration is an unused-function warning, which -D warnings would fail on.
    Both pass.
  • Category check: the category is "the guard's name does not match its
    siblings' shape". Covered: the one name. Nothing else is touched, and
    agreeSpread / agreeAnchor / agreeLimit keep their noun-phrase names
    because those already fit.

Verification

33 agree tests pass, forge lint -D warnings and forge fmt --check both exit
0.

🤖 Generated with Claude Code

`agreeValidateTolerances` read as "agree validate tolerances". Its
siblings — `agreeSpread`, `agreeAnchor`, `agreeLimit` — are noun phrases
naming what they return, so the prefix carries the association and the
rest of the name says what the value is. A verb belongs at the front:
`validateAgreeTolerances` reads as English and still says which
function's tolerances it validates.

Private, so nothing outside the library refers to it. No behaviour
change; 33 agree tests pass unchanged, lint and fmt clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 38 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: 75c48830-51ce-45c1-a925-fff097f702e3

📥 Commits

Reviewing files that changed from the base of the PR and between 7db9847 and a1f16d1.

📒 Files selected for processing (1)
  • src/lib/LibDecimalFloat.sol

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.

@thedavidmeister

Copy link
Copy Markdown
Contributor Author

Closing: a private helper rename is not worth a PR, a release and a consumer bump.

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.

1 participant