HTML docs say --strict "[e]nable[s] all optional error checking flags"; it does not
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 1/5
- 預估耗時
- 1 小時以內
- 新手友好度
- 90/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
從 docs/source/config_file.rst 開始,該檔案似乎會產生受影響的 HTML 文件,並對照其中引用的 mypy --help 輸出閱讀 strict 選項的措辭。更新該說法,使其準確描述所選的選擇性錯誤檢查旗標,然後確認轉譯後的 config_file 文件不再表示所有選擇性旗標都已啟用。
由索引模型根據 Issue 內容生成。
描述
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
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/mypy 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
documentation
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug topic-configuration topic-error-reporting
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
bug topic-attrs
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
難度 2/5 1-2 天 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 7 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
lmstudio-ai/mlx-engine#376 ·
-
難度 2/5 1-3 小時 新手友好度 72/100
pyiron/bagofholding#166 ·