python / python/mypy

cached runs of dmypy stop reporting "unused type: ignore" warnings

未关闭
#9,655 22 条评论 10 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug topic-daemon topic-type-ignore
主要语言
Python
星标
20.6k
派生
3.3k
PR 合并指标
PR 指标待抓取

描述

Using mypy 0.782, I run
dmypy run .

on my codebase. The first time it runs, it correctly reports a few

error: unused 'type: ignore' comment

same as mypy. However, when rerunning dmypy run ., these errors disappear, while all other errors remain.

For some reason, this type of warning (warn_unused_ignores) seems to be missed sometimes when using the cache.

Unfortunately, it doesn't seem trivial to reproduce, so I can't give a reproducible project right now...

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从入口点 dmypy run . 开始,调查缓存运行与初始运行相比如何处理 warn_unused_ignores。如果可能,请在包含未使用的 type: ignore 注释的代码库上运行两次 dmypy run . 以重现差异;当这些警告在缓存运行和未缓存运行之间保持一致时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。