-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove empty strings when converting to f-string (
UP032
) (#11524)
## Summary This PR brings back the functionality to remove empty strings when converting to an f-string in `UP032`. For context, #8712 added this functionality to remove _trailing_ empty strings but it got removed in #8697 possibly unexpectedly so. There's one difference which is that this PR will remove _any_ empty strings and not just trailing ones. For example, ```diff --- /Users/dhruv/playground/ruff/src/UP032.py +++ /Users/dhruv/playground/ruff/src/UP032.py @@ -1,7 +1,5 @@ ( - "{a}" - "" - "{b}" - "" -).format(a=1, b=1) + f"{1}" + f"{1}" +) ``` ## Test Plan Run `cargo insta test` and update the snapshots.
- Loading branch information
1 parent
5dcde88
commit 9200dfc
Showing
2 changed files
with
52 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters