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 摘要。