diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index b5081f113f91..f24d39060879 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -924,6 +924,15 @@ in error messages. ``file:line:column:end_line:end_column``. This option implies ``--show-column-numbers``. +.. option:: --show-error-codes + + This flag will show the error code ``[]`` after each error message. This is the + default behavior:: + + prog.py:1: error: "str" has no attribute "trim" [attr-defined] + + See :ref:`error-codes` for more information. + .. option:: --hide-error-codes This flag will hide the error code ``[]`` from error messages. By default, the error diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index 77f952471007..4ebf46b7d3d8 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -894,6 +894,15 @@ These options may only be set in the global section (``[mypy]``). Shows documentation link to corresponding error code. +.. confval:: show_error_codes + + :type: boolean + :default: True + + Shows error codes in error messages. See :ref:`error-codes` for more information. + + This is the default behavior. To hide error codes, use :confval:`hide_error_codes` instead. + .. confval:: hide_error_codes :type: boolean