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

[refurb] Implement unnecessary-from-float (FURB164) #10647

Conversation

boolean-light
Copy link
Contributor

Summary

Implement FURB164 in the issue #1348.
Relevant Refurb docs is here: https://github.com/dosisod/refurb/blob/v2.0.0/docs/checks.md#furb164-no-from-float

I've changed the name from no-from-float to verbose-decimal-fraction-construction.

Test Plan

I've written it in the FURB164.py.

@charliermarsh
Copy link
Member

Maybe verbose_fraction_construction?

@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Mar 28, 2024
@charliermarsh charliermarsh self-assigned this Mar 28, 2024
Copy link
Contributor

github-actions bot commented Mar 28, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@boolean-light
Copy link
Contributor Author

I have thought of that, but should we incorporate Decimal as it is checks for both constructions of Decimal and Fraction?

@boolean-light
Copy link
Contributor Author

Also I'm not very sure why cargo test for wasm is failing... Let me check on that.

@MichaReiser
Copy link
Member

It sometimes has this error. Let me re-run it to see if it resolves the issue.

/// Decimal(4.2)
/// Decimal("inf")
/// Fraction(4.2)
/// Fraction(Decimal("4.2"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the inner "4.2" be 4.2?

@charliermarsh charliermarsh changed the title [refurb] Implement verbose-decimal-fraction-construction (FURB164) [refurb] Implement unnecessary-from-float (FURB164) Mar 30, 2024
@charliermarsh charliermarsh force-pushed the verbose-decimal-fraction-construction branch from c0db3d9 to 20223cb Compare March 30, 2024 02:14
Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@charliermarsh charliermarsh enabled auto-merge (squash) March 30, 2024 02:15
auto-merge was automatically disabled March 30, 2024 10:50

Head branch was pushed to by a user without write access

@boolean-light
Copy link
Contributor Author

Sorry for the late response and thanks for the review!

@charliermarsh charliermarsh merged commit 9ad9cea into astral-sh:main Mar 30, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants