astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.

Home Page:https://docs.astral.sh/ruff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

NeilGirdhar opened this issue · comments

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?

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

This sounds like a good refurb rule. @dosisod