Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions docs/source/error_code_list2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ Example:
# Python 3.8, or Python 3.9
42 + "testing..." # type: ignore

If a narrower code (a subcode) is ignored by specifying a wider code, this counts
as an instance of unused-ignore. (The wider code is, conceptually, partially unused.)
For more information about subcodes, see :ref:`subcodes-of-error-codes`.

.. _code-explicit-override:

Check that ``@override`` is used when overriding a base class method [explicit-override]
Expand Down
5 changes: 5 additions & 0 deletions docs/source/error_codes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ 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:

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

Expand All @@ -110,6 +112,9 @@ is a subcode of another one, it will be mentioned in the documentation for the n
code. This hierarchy is not nested: there cannot be subcodes of other
subcodes.

If a narrower code is ignored by specifying a wider code, this counts as an instance of
:ref:`unused-ignore<code-unused-ignore>`. (The wider code is, conceptually, partially
unused.)

Requiring error codes
---------------------
Expand Down