Skip to content

Add a flag --enable-all-error-codes, which enables all error codes #19048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3f952b9
add all error code
wyattscarpenter May 7, 2025
31e2b72
formatting fixes
wyattscarpenter May 7, 2025
c0e6aeb
manual experimentation reveals that this code only works for the comm…
wyattscarpenter May 7, 2025
469de61
add a spotcheck test for error code all
wyattscarpenter May 8, 2025
ccb62cb
oh, right, overrides is in typing_extensions
wyattscarpenter May 8, 2025
34d218e
I guess these need tuples
wyattscarpenter May 8, 2025
035d4d6
since I'm getting more weird errors, let's try builtins fixtures/prim…
wyattscarpenter May 8, 2025
0d50f97
...try typing fixtures/typing-full.pyi
wyattscarpenter May 8, 2025
b8fbb34
ok now tuple is missing again. so let's try both
wyattscarpenter May 8, 2025
dd4a343
try tuple simple
wyattscarpenter May 8, 2025
787c680
fix all of the test fixture complaints
wyattscarpenter May 8, 2025
07710bf
begin pivoting to --enable-all-error-codes
wyattscarpenter May 11, 2025
6728040
pivot to --enable-all-error-codes flag
wyattscarpenter May 11, 2025
465ea8c
document, and add a new test
wyattscarpenter May 11, 2025
9e98209
fix some typos / confusing language I found along the way
wyattscarpenter May 11, 2025
0b32309
improve documentation
wyattscarpenter May 11, 2025
ad5dac3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 11, 2025
8066787
remember that I was supposed to mention this in --strict
wyattscarpenter May 11, 2025
7bae510
allow --enable-all-error-codes to be countermanded
wyattscarpenter May 11, 2025
bf1fc81
new tests for countermanding
wyattscarpenter May 11, 2025
ff5f284
Merge branch 'master' into error_code_all
wyattscarpenter Jun 4, 2025
65f6bcc
another test that would work if enable-all-error-codes was also a per…
wyattscarpenter Jul 30, 2025
22e56a8
-xfail testSpotCheckEnableAllErrorCodesConfigCountermand for error_co…
wyattscarpenter Jul 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
begin pivoting to --enable-all-error-codes
  • Loading branch information
wyattscarpenter committed May 11, 2025
commit 07710bf8df32e70cf39f3687e7e51719d5631e15
10 changes: 0 additions & 10 deletions docs/source/error_code_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ with default options. See :ref:`error-codes` for general documentation
about error codes. :ref:`error-codes-optional` documents additional
error codes that you can enable.

.. _code-all:

Enable all error codes
----------------------

While not really an error code mypy will ever display, providing ``all``
as an error code to be enabled (via the command-line) enables
all optional error codes. (Remember that enabling takes priority over
disabling, so other --disable-error-code flags will not countermand this.)

.. _code-attr-defined:

Check that attribute exists [attr-defined]
Expand Down
4 changes: 1 addition & 3 deletions docs/source/error_codes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ and :option:`--disable-error-code <mypy --disable-error-code>`
to enable or disable specific error codes that don't have a dedicated
command-line flag or config file setting.

While not really an error code mypy will ever display, providing ``all``
as an error code to be enabled (via the command-line) enables
:option:`--enable-all-error-codes <mypy --enable-all-error-codes>` enables
all optional error codes. (Remember that enabling takes priority over
disabling, so other --disable-error-code flags will not countermand this.)

Expand Down Expand Up @@ -104,7 +103,6 @@ So one can e.g. enable some code globally, disable it for all tests in
the corresponding config section, and then re-enable it with an inline
comment in some specific test.


Subcodes of error codes
-----------------------

Expand Down
6 changes: 0 additions & 6 deletions mypy/errorcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ def __hash__(self) -> int:
"await-not-async", 'Warn about "await" outside coroutine ("async def")', "General"
)
# These error codes aren't enabled by default.
ALL: Final[ErrorCode] = ErrorCode(
"all",
"Enable all error codes for mypy (although not necessarily for plugins), including the optional ones that are off by default",
"General",
default_enabled=False,
)
NO_UNTYPED_DEF: Final[ErrorCode] = ErrorCode(
"no-untyped-def", "Check that every function has an annotation", "General"
)
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy