Skip to content

Add rule to remove floor division operations - #230

Merged
jeparlefrancais merged 4 commits into
mainfrom
remove-floor-division
Nov 22, 2024
Merged

jeparlefrancais merged 4 commits into
mainfrom
remove-floor-division

Conversation

@jeparlefrancais

@jeparlefrancais jeparlefrancais commented Nov 22, 2024 •

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown

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
@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