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

Update Stylist quote detection to use the new f-string tokens #7293

Closed
Tracked by #7299
dhruvmanila opened this issue Sep 12, 2023 · 0 comments · Fixed by #7328
Closed
Tracked by #7299

Update Stylist quote detection to use the new f-string tokens #7293

dhruvmanila opened this issue Sep 12, 2023 · 0 comments · Fixed by #7328
Assignees
Labels
core Related to core functionality python312 Related to Python 3.12

Comments

@dhruvmanila
Copy link
Member

Update the detect_quote function to either use the String or FStringStart token to detect the quote (single or double).

This should probably be enough as the FStringStart token contains the prefix and quotes for the f-string:

    let quote_range = tokens.iter().flatten().find_map(|(t, range)| match t {
        Tok::String {
            triple_quoted: false,
            ..
-        } => Some(*range),
+        }
+        | Tok::FStringStart => Some(*range),
        _ => None,
    });
@dhruvmanila dhruvmanila added rule Implementing or modifying a lint rule python312 Related to Python 3.12 core Related to core functionality and removed rule Implementing or modifying a lint rule labels Sep 12, 2023
@dhruvmanila dhruvmanila self-assigned this Sep 13, 2023
@dhruvmanila dhruvmanila linked a pull request Sep 13, 2023 that will close this issue
dhruvmanila added a commit that referenced this issue Sep 15, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 18, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 19, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 20, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 22, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 22, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 22, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 26, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 27, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 28, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 29, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
dhruvmanila added a commit that referenced this issue Sep 29, 2023
## Summary

This PR updates `Stylist` quote detection to include the f-string
tokens.

As f-strings cannot be used as docstrings, we'll skip the check for
triple-quoted f-strings.

## Test Plan

Add new test cases with f-strings.

fixes: #7293
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to core functionality python312 Related to Python 3.12
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant