diff --git a/docs/source/error_code_list2.rst b/docs/source/error_code_list2.rst index bd2436061974..8e850a52c7fb 100644 --- a/docs/source/error_code_list2.rst +++ b/docs/source/error_code_list2.rst @@ -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] diff --git a/docs/source/error_codes.rst b/docs/source/error_codes.rst index 485d70cb59bc..d9bb3ee68d06 100644 --- a/docs/source/error_codes.rst +++ b/docs/source/error_codes.rst @@ -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 ----------------------- @@ -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`. (The wider code is, conceptually, partially +unused.) Requiring error codes ---------------------