P3good first issueparsing-imports
仓库指标
- 星标
- (288 个星标)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
Describe the bug
Code which is protected by TYPE_CHECKING is listed as a required import. I'm not sure if to class this as a bug or a feature request but this template fits better.
For example:
from typing import TYPE_CHECKING
import foo
if TYPE_CHECKING:
import bar
To Reproduce
bash-5.2$ echo $'from typing import TYPE_CHECKING\nimport foo\nif TYPE_CHECKING:\n import bar' | fawltydeps --list-imports --code - --detailed
<stdin>:2: foo
<stdin>:4: bar
Expected behavior
Import protected by TYPE_CHECKING can be ignored.
Environment
- Version of the code: 0.13.2
Additional context