Closed alphatownsman closed 10 months ago
Seems related to #375
EDIT: Fix submitted: #391
This is due to https://github.com/Instagram/LibCST/issues/389 .
Simplified repro:
VALID = [
...
Valid('"True" == "True"'), # passes
Valid('"True" != "False".lower()'), # fails
Valid('lower = lambda x: x.lower()\n"True" != lower("False")'), # passes
Valid('"True" != lower("False")'), # passes
]
dap> right_comp
...
func: Attribute(\n value=SimpleString(\n value='"False"',\n lpar=[],\n rpar=[],\n ),\n attr=Name(\n value='lower',\n lpar=[]
...
dap> self.metadata[QualifiedNameProvider][right_comp]()
{QualifiedName(name='...ILTIN: 2>)}
4354005056: QualifiedName(name='builtins.None', source=<QualifiedNameSource.BUILTIN: 2>)
function variables:
len(): 1
special variables:
dap>
I think it should either return {String.lower} or {}, not {None}?
That being said, I think the lint issue could be fixed by just not using QualifiedNameProvider. You can just look at the node directly.
It seems this autofix is changing the logic for no good reason?