Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

[F821] undefined name name #79

@SigureMo

Description

@SigureMo

此前统计 88 处

个人感觉十分有用,可以将问题提前到静态分析阶段而非仅仅依靠 runtime,但是目测现有问题都是需要 ignore 的(比如单测的 parameterize),之后考虑是全局 ignore 还是对某些文件 ignore

Note

PyTorch 直接全局 ignore 了 F821(https://github.com/pytorch/pytorch/blob/master/.flake8

UPDATE:

引入 black 后统计为 75 处,需要针对不同情况考虑各自的修复方案,只能逐个手动修复

关于 parameterize,考虑重写 parameterize 装饰器,使其像 pytest 里的 pytest.mark.parametrize 那样通过函数参数传入,就不会有这个问题了,不过尚未测试过

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions