HTML docs say --strict "[e]nable[s] all optional error checking flags"; it does not
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.
Source: python/mypy