ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Add a rule to catch int(round(...)

Open NeilGirdhar opened this issue 1 year ago • 2 comments
trafficstars

int(round(x))and int(round(x, 0)) and int(round(x, None)) can all simply be written round(x). However, unnecessary casts to int are prevalent. Please consider adding a rule to catch these?

NeilGirdhar avatar May 13 '24 16:05 NeilGirdhar

Seems reasonable to me. unnecessary-round-cast or something?

zanieb avatar May 13 '24 17:05 zanieb

This sounds like a good refurb rule. @dosisod

Skylion007 avatar May 17 '24 15:05 Skylion007