Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#22,057 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
90/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu trong docs/source/config_file.rst, tệp dường như tạo ra tài liệu HTML bị ảnh hưởng, và đọc cách diễn đạt về tùy chọn strict cùng với đầu ra mypy --help mà nó tham chiếu. Cập nhật nhận định để mô tả chính xác các flag tùy chọn kiểm tra lỗi được chọn, sau đó xác minh rằng tài liệu config_file đã render không còn nói rằng tất cả các flag tùy chọn đều được bật.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
20.6k
Fork
3.3k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
64

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python/mypy

Tất cả issue của python/mypy

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.