Skip to content

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

@dhruvmanila

Description

@dhruvmanila

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.

Metadata

Metadata

Assignees

Labels

python312Related to Python 3.12ruleImplementing or modifying a lint rule

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions