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 verbose-decimal-constructor (FURB157) #10533

Merged
merged 5 commits into from
Mar 25, 2024

Conversation

boolean-light
Copy link
Contributor

Summary

Implement FURB157 in the issue #1348.
Relevant Refurb docs is here: https://github.com/dosisod/refurb/blob/master/docs/checks.md#furb157-simplify-decimal-ctor

Test Plan

I've written it in the FURB157.py.

Copy link
Contributor

github-actions bot commented Mar 23, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+14 -0 violations, +0 -0 fixes in 4 projects; 40 projects unchanged)

apache/airflow (+3 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ tests/providers/teradata/transfers/test_teradata_to_teradata.py:86:33: FURB157 [*] Verbose expression in `Decimal` constructor
+ tests/providers/teradata/transfers/test_teradata_to_teradata.py:86:58: FURB157 [*] Verbose expression in `Decimal` constructor
+ tests/providers/teradata/transfers/test_teradata_to_teradata.py:86:83: FURB157 [*] Verbose expression in `Decimal` constructor

rotki/rotki (+7 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ rotkehlchen/fval.py:63:68: FURB157 [*] Verbose expression in `Decimal` constructor
+ rotkehlchen/fval.py:67:68: FURB157 [*] Verbose expression in `Decimal` constructor
+ rotkehlchen/fval.py:71:69: FURB157 [*] Verbose expression in `Decimal` constructor
+ rotkehlchen/fval.py:71:84: FURB157 [*] Verbose expression in `Decimal` constructor
+ rotkehlchen/fval.py:75:69: FURB157 [*] Verbose expression in `Decimal` constructor
+ rotkehlchen/fval.py:75:83: FURB157 [*] Verbose expression in `Decimal` constructor
+ rotkehlchen/fval.py:86:68: FURB157 [*] Verbose expression in `Decimal` constructor

zulip/zulip (+2 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ corporate/tests/test_stripe.py:5525:82: FURB157 [*] Verbose expression in `Decimal` constructor
+ corporate/tests/test_stripe.py:5587:41: FURB157 [*] Verbose expression in `Decimal` constructor

indico/indico (+2 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ indico/modules/events/registration/models/registrations.py:510:49: FURB157 [*] Verbose expression in `Decimal` constructor
+ indico/modules/events/registration/models/registrations.py:511:61: FURB157 [*] Verbose expression in `Decimal` constructor

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
FURB157 14 14 0 0 0

@charliermarsh charliermarsh self-requested a review March 24, 2024 20:15
@charliermarsh charliermarsh self-assigned this Mar 24, 2024
@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Mar 24, 2024
@charliermarsh charliermarsh changed the title [Refurb] Implement simplify-decimal-ctor (FURB157) [Refurb] Implement verbose-decimal-constructor (FURB157) Mar 25, 2024
@charliermarsh charliermarsh changed the title [Refurb] Implement verbose-decimal-constructor (FURB157) [refurb] Implement verbose-decimal-constructor (FURB157) Mar 25, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) March 25, 2024 02:15
Copy link

codspeed-hq bot commented Mar 25, 2024

CodSpeed Performance Report

Merging #10533 will degrade performances by 5.31%

Comparing boolean-light:simplify-decimal-ctor (655821b) with main (22f237f)

Summary

❌ 2 regressions
✅ 28 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main boolean-light:simplify-decimal-ctor Change
linter/default-rules[large/dataset.py] 19.3 ms 20.3 ms -5.31%
linter/default-rules[unicode/pypinyin.py] 1.5 ms 1.6 ms -4.51%

@charliermarsh
Copy link
Member

That looks like a false positive given that the default rule set didn't change here... I'll re-run though.

@charliermarsh charliermarsh merged commit 39fb6d9 into astral-sh:main Mar 25, 2024
16 of 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.

2 participants