Skip to content

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

Merged
charliermarsh merged 7 commits intoastral-sh:mainfrom
hikaru-kajita:verbose-decimal-fraction-construction
Mar 30, 2024
Merged

[refurb] Implement unnecessary-from-float (FURB164)#10647
charliermarsh merged 7 commits intoastral-sh:mainfrom
hikaru-kajita:verbose-decimal-fraction-construction

Conversation

@hikaru-kajita
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
@github-actions
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.

@hikaru-kajita
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?

@hikaru-kajita
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

@hikaru-kajita
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
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.

3 participants