Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rule to remove floor division operations #230

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

jeparlefrancais
Copy link
Contributor

@jeparlefrancais jeparlefrancais commented Nov 22, 2024

Closes #160

Add a new rule remove_floor_division to remove usage of // in expressions or compound assignments (//=). The code is replaced with a math.floor call on a regular division.

  • add entry to the changelog
  • add documentation

Copy link

Coverage after merging remove-floor-division into main will be

86.13%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
src/nodes/expressions
   binary.rs94.44%100%100%93.92%271, 57–59, 67–69, 71–73, 77–82, 91
src/rules
   mod.rs89.13%100%82.86%89.90%118–120, 134–136, 154–156, 158, 189–191, 289, 329–331, 358, 365–368, 382, 431–433
   remove_compound_assign.rs97.49%100%95.83%97.67%272–274, 55, 83
   remove_floor_division.rs89.11%100%100%87.50%100–108, 47–48

@jeparlefrancais jeparlefrancais merged commit 38ff2da into main Nov 22, 2024
6 checks passed
@jeparlefrancais jeparlefrancais deleted the remove-floor-division branch November 22, 2024 21:16
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.

Add rule to remove floor division operator
1 participant