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 ISC001, ISC002 to check in f-strings #7298

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

Update ISC001, ISC002 to check in f-strings #7298

dhruvmanila opened this issue Sep 12, 2023 · 0 comments · Fixed by #7515
Assignees
Labels
python312 Related to Python 3.12 rule Implementing or modifying a lint rule

Comments

@dhruvmanila
Copy link
Member

ISC001 and ISC002 checks for implicitly concatenated strings over a single or multiple lines.

The rules needs to be updated to account for the f-strings. The implementation using ranges to check if 2 consecutive strings are implicitly concatenated.

Proposed solution

  1. We'll need to get the f-string range from the Indexer when we encounter a FStringStart token.
  2. Another solution would be to consume all of the tokens from FStringStart to FStringEnd to get the range. I think using the Indexer is better.
@dhruvmanila dhruvmanila added rule Implementing or modifying a lint rule python312 Related to Python 3.12 labels Sep 12, 2023
@dhruvmanila dhruvmanila self-assigned this Sep 17, 2023
@dhruvmanila dhruvmanila linked a pull request Sep 19, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python312 Related to Python 3.12 rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant