Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

HTML docs say --strict "[e]nable[s] all optional error checking flags"; it does not

未关闭 适合新手
#22,057 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
90/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
documentation

调研方向

从 docs/source/config_file.rst 开始,该文件似乎会生成受影响的 HTML 文档,并结合其中引用的 mypy --help 输出阅读 strict 选项的措辞。更新该表述,使其准确描述所选的可选错误检查标志,然后验证渲染后的 config_file 文档不再声称所有可选标志都已启用。

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

描述

bug documentation

Bug Report

The HTML documentation, as of mypy-2.3.1, incorrectly claims that --strict enables all optional error checking flags:

strict
[...]
Enable all optional error checking flags. You can see the list of flags enabled by strict mode in the full mypy --help output.

Note: the exact list of flags enabled by strict may change over time.

The second sentence is correct, the first is not. My suggestion would be to change wording to "Enable selected optional error checking flags."

(It appears that the HTML documentation may be generated from docs/source/config_file.rst. This wording is still present in latest, which is currently mypy 2.4.0+dev.0861bb6450d6d3658e44dbca9cd2ba478faf3c1d.)

To Reproduce

As one example, mypy --strict does not enable --enable-error-code=ignore-without-code, as demonstrated by

$ echo '1 == "str"  # type: ignore' >/tmp/wrong.py
$ mypy --strict /tmp/wrong.py
Success: no issues found in 1 source file
$ mypy --strict --enable-error-code=ignore-without-code /tmp/wrong.py
/tmp/wrong.py:1: error: "type: ignore" comment without error code (consider "type: ignore[comparison-overlap]" instead)  [ignore-without-code]
Found 1 error in 1 file (checked 1 source file)

Your Environment

mypy was run via uv run --isolated --with 'mypy==2.3.1' mypy [...] on Ubuntu 24.04 LTS, with no pyproject.toml in the directory it was run from.

主要语言
Python
星标
20.6k
派生
3.3k
平均合并
1 天 1 小时
30 天内合并 PR
61

环境准备

从这里开始

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

python/mypy 的其他 Issue

查看 python/mypy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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