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

False positive for RUF057 with negative ndigits #15221

Closed
UnknownPlatypus opened this issue Jan 2, 2025 · 3 comments · Fixed by #15234
Closed

False positive for RUF057 with negative ndigits #15221

UnknownPlatypus opened this issue Jan 2, 2025 · 3 comments · Fixed by #15234
Assignees
Labels
bug Something isn't working preview Related to preview mode features

Comments

@UnknownPlatypus
Copy link
Contributor

ruff propose this change:

-round(150, -2)
+150

which is not valid since round(150, -2) == 200

I believe negative ndigits should be skipped

Related to #14828

@MichaReiser
Copy link
Member

CC: @InSyncWithFoo

@MichaReiser MichaReiser added bug Something isn't working preview Related to preview mode features labels Jan 2, 2025
@InSyncWithFoo
Copy link
Contributor

Got it. Fix coming tomorrow.

@MichaReiser
Copy link
Member

Awesome, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preview Related to preview mode features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants