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 a rule to catch int(round(...) #11412

Open
NeilGirdhar opened this issue May 13, 2024 · 2 comments
Open

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

NeilGirdhar opened this issue May 13, 2024 · 2 comments
Labels
rule Implementing or modifying a lint rule

Comments

@NeilGirdhar
Copy link

NeilGirdhar commented May 13, 2024

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?

@zanieb zanieb added the rule Implementing or modifying a lint rule label May 13, 2024
@zanieb
Copy link
Member

zanieb commented May 13, 2024

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

@Skylion007
Copy link

This sounds like a good refurb rule. @dosisod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

3 participants