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

FURB152 should look at additional digits to reduce false positives #9281

Closed
hauntsaninja opened this issue Dec 26, 2023 · 2 comments · Fixed by #9290
Closed

FURB152 should look at additional digits to reduce false positives #9281

hauntsaninja opened this issue Dec 26, 2023 · 2 comments · Fixed by #9290
Labels
bug Something isn't working

Comments

@hauntsaninja
Copy link
Contributor

For example, it'll trigger on the following program

x = 2.7139914879495697

I think the rule should avoid erroring if there are additional decimal digits that do not match, so:

bad1 = 2.7182
bad2 = 2.7183
good1 = 2.71824
good2 = 2.71820001
@charliermarsh
Copy link
Member

Trying to figure out what the best approach is here. I may need to look at what other tools do. E.g., what if the user rounds at some decimal point?

@hauntsaninja
Copy link
Contributor Author

Thanks! Issue description mentions how I think rounding should be done; I opened a PR for this at #9290

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

Successfully merging a pull request may close this issue.

2 participants