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 fstring-number-format (FURB116) #10921

Merged
merged 6 commits into from
Apr 26, 2024

Conversation

diceroll123
Copy link
Contributor

Summary

Adds FURB116

See #1348

Test Plan

cargo test

@diceroll123
Copy link
Contributor Author

Not too sure how I'd reliably be able to support expressions that can include strings, such as calls, like in my int(f"{num}") test, for example. Please advise if that can be better! 😄

Copy link
Contributor

github-actions bot commented Apr 14, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Comment on lines 106 to 112
let Expr::Name(ast::ExprName { id, .. }) = func.as_ref() else {
return;
};

if !checker.semantic().is_builtin(id) {
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If #10919 is merged before this, I'll update accordingly.

Copy link
Member

Choose a reason for hiding this comment

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

it was merged ;)

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 added rule Implementing or modifying a lint rule preview Related to preview mode features labels Apr 26, 2024
@charliermarsh charliermarsh changed the title [refurb] - add fstring-number-format with sometimes-autofix (FURB116) [refurb] Implement fstring-number-format (FURB116) Apr 26, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) April 26, 2024 01:07
@charliermarsh charliermarsh merged commit c8c227d into astral-sh:main Apr 26, 2024
18 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