-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider raw source code for
W605
(#10480)
## Summary This PR fixes a panic in the linter for `W605`. Consider the following f-string: ```python f"{{}}ab" ``` The `FStringMiddle` token would contain `{}ab`. Notice that the escaped braces have _reduced_ the string. This means we cannot use the text value from the token to determine the location of the escape sequence but need to extract it from the source code. fixes: #10434 ## Test Plan Add new test cases and update the snapshots.
- Loading branch information
1 parent
bc9b457
commit 42d4216
Showing
3 changed files
with
60 additions
and
3 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
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