Update Q000, Q001 with the new f-string tokens#7589
Merged
dhruvmanila merged 4 commits intodhruv/pep-701from Sep 27, 2023
Merged
Update Q000, Q001 with the new f-string tokens#7589dhruvmanila merged 4 commits intodhruv/pep-701from
Q000, Q001 with the new f-string tokens#7589dhruvmanila merged 4 commits intodhruv/pep-701from
Conversation
Member
Author
This was referenced Sep 22, 2023
1d2fcf3 to
ec2f581
Compare
CodSpeed Performance ReportMerging #7589 will not alter performanceComparing Summary
|
Q000-002 with the new f-string tokensQ000, Q001 with the new f-string tokens
MichaReiser
approved these changes
Sep 22, 2023
crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs
Outdated
Show resolved
Hide resolved
ec2f581 to
27f4eeb
Compare
587aa71 to
2d9069a
Compare
2d9069a to
7753ce8
Compare
27f4eeb to
715b5df
Compare
7753ce8 to
51f7ef1
Compare
715b5df to
9eb2dc4
Compare
dhruvmanila
added a commit
that referenced
this pull request
Sep 28, 2023
## Summary This PR updates the `Q000`, and `Q001` rules to consider the new f-string tokens. The docstring rule (`Q002`) doesn't need to be updated because f-strings cannot be used as docstrings. I tried implementing the nested f-string support but there are still some edge cases in my current implementation so I've decided to pause it for now and I'll pick it up sometime soon. So, for now this doesn't support nested f-strings. ### Implementation The implementation uses the same `FStringRangeBuilder` introduced in #7586 to build up the outermost f-string range. The reason to use the same implementation is because this is a temporary solution until we add support for nested f-strings. ## Test Plan `cargo test`
dhruvmanila
added a commit
that referenced
this pull request
Sep 29, 2023
## Summary This PR updates the `Q000`, and `Q001` rules to consider the new f-string tokens. The docstring rule (`Q002`) doesn't need to be updated because f-strings cannot be used as docstrings. I tried implementing the nested f-string support but there are still some edge cases in my current implementation so I've decided to pause it for now and I'll pick it up sometime soon. So, for now this doesn't support nested f-strings. ### Implementation The implementation uses the same `FStringRangeBuilder` introduced in #7586 to build up the outermost f-string range. The reason to use the same implementation is because this is a temporary solution until we add support for nested f-strings. ## Test Plan `cargo test`
dhruvmanila
added a commit
that referenced
this pull request
Sep 29, 2023
## Summary This PR updates the `Q000`, and `Q001` rules to consider the new f-string tokens. The docstring rule (`Q002`) doesn't need to be updated because f-strings cannot be used as docstrings. I tried implementing the nested f-string support but there are still some edge cases in my current implementation so I've decided to pause it for now and I'll pick it up sometime soon. So, for now this doesn't support nested f-strings. ### Implementation The implementation uses the same `FStringRangeBuilder` introduced in #7586 to build up the outermost f-string range. The reason to use the same implementation is because this is a temporary solution until we add support for nested f-strings. ## Test Plan `cargo test`
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR updates the
Q000, andQ001rules to consider the new f-string tokens. The docstring rule (Q002) doesn't need to be updated because f-strings cannot be used as docstrings.I tried implementing the nested f-string support but there are still some edge cases in my current implementation so I've decided to pause it for now and I'll pick it up sometime soon. So, for now this doesn't support nested f-strings.
Implementation
The implementation uses the same
FStringRangeBuilderintroduced in #7586 to build up the outermost f-string range. The reason to use the same implementation is because this is a temporary solution until we add support for nested f-strings.Test Plan
cargo test