You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hardcoded-string-charset (FURB156) has a false positive with an incorrect fix. Given an expression of the form <expression> in <string literal>, the rule tries to replace the string literal with a variable from the string module, ignoring the order of the characters in the string literal. That is only valid when the left-hand-side expression is a string of length 1. If it is multiple characters, reordering the characters in the right-hand-side expression can change the value of the in operation.
…sets (#14233)
## Summary
It's only safe to enforce the `x in "1234567890"` case if `x` is exactly
one character, since the set on the right has been reordered as compared
to `string.digits`. We can't know if `x` is exactly one character unless
it's a literal. And if it's a literal, well, it's kind of silly code in
the first place?
Closes#13802.
hardcoded-string-charset
(FURB156) has a false positive with an incorrect fix. Given an expression of the form<expression> in <string literal>
, the rule tries to replace the string literal with a variable from thestring
module, ignoring the order of the characters in the string literal. That is only valid when the left-hand-side expression is a string of length 1. If it is multiple characters, reordering the characters in the right-hand-side expression can change the value of thein
operation.The text was updated successfully, but these errors were encountered: