Instagram / Instagram/LibCST

RemoveUnusedImports codemod incorrectly removes this

Open
#498 1 comment 1 reaction 0 assignees View on GitHub
bug codemod
Dominant language
Python
Stars
1.9k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

```
class X:
import random
a = [random.lol for _ in ()]
```

`random` here is used by the class body, but gets removed by the codemod. This might be because ScopeProvider doesn't connect the access in the list comprehension with the class-local import.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.