Skip to content

fix(lint): catch divide-before-multiply on rhs of multiplication#14257

Open
cuiweixie wants to merge 1 commit intofoundry-rs:masterfrom
cuiweixie:fix/lint-divide-before-multiply-rhs
Open

fix(lint): catch divide-before-multiply on rhs of multiplication#14257
cuiweixie wants to merge 1 commit intofoundry-rs:masterfrom
cuiweixie:fix/lint-divide-before-multiply-rhs

Conversation

@cuiweixie
Copy link
Copy Markdown
Contributor

Summary

The divide-before-multiply lint only walked the left operand of a multiplication, so x * (y / z) was missed. Bind the right-hand Binary operand and emit when either side contains a division.

Test plan

  • cargo check -p forge-lint

DivideBeforeMultiply only inspected the left operand of *. Also scan\nthe right operand so patterns like x * (y / z) are reported, matching\nthe lint's precision guidance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant