[ruff] Recognize t-strings, generators, and lambdas in invalid-index-type (RUF016)#20213
Conversation
|
dylwil3
left a comment
There was a problem hiding this comment.
Thanks! I think this looks right, but it's hard to review the snapshot until the fixtures get moved to the end, so I'll take a second look once you've done that 😄
| fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
| match self { | ||
| Self::FString => f.write_str("str"), | ||
| Self::TString => f.write_str("str"), |
There was a problem hiding this comment.
t-strings do not have type str but rather type Template (or string.templatelib.Template)
There was a problem hiding this comment.
I changed it to Template.
There was a problem hiding this comment.
Can you move the new fixtures to the end and put a comment with a link to the issue? It makes the diff in the snapshot a little easier to review since it doesn't change all the line numbers
There was a problem hiding this comment.
I've moved them to the end of the file.
remove a comment
91648d0 to
70b7075
Compare
ruff] Recognize t-strings, generators, and lambdas in RUF016ruff] Recognize t-strings, generators, and lambdas in invalid-index-type (RUF016)
Summary
Fixes #20204
Recognize t-strings, generators, and lambdas in RUF016
CheckableExprType.Test Plan
I've added test cases for t-string, generator and lambda to RUF016.py.