Skip to content

[refurb] Implement fstring-number-format (FURB116)#10921

Merged
charliermarsh merged 6 commits intoastral-sh:mainfrom
diceroll123:add-FURB116
Apr 26, 2024
Merged

[refurb] Implement fstring-number-format (FURB116)#10921
charliermarsh merged 6 commits intoastral-sh:mainfrom
diceroll123:add-FURB116

Conversation

@diceroll123
Copy link
Copy Markdown
Contributor

Summary

Adds FURB116

See #1348

Test Plan

cargo test

@diceroll123
Copy link
Copy Markdown
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! 😄

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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