From 0f40112616def961be6eabcfe569cb2821c20226 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Thu, 31 Jul 2025 01:16:52 -0400 Subject: [PATCH 1/3] Update index.rst: add exit_codes Part of closing https://github.com/python/mypy/issues/6003 --- docs/source/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/index.rst b/docs/source/index.rst index de3286d58ace..ab11c1a1c077 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -101,6 +101,7 @@ Contents error_codes error_code_list error_code_list2 + exit_codes additional_features faq changelog From 0f2e7aa32fa497e18b371511988b63a631817bc9 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Thu, 31 Jul 2025 01:30:56 -0400 Subject: [PATCH 2/3] Create exit_codes.rst Closes #6003 --- docs/source/exit_codes.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/source/exit_codes.rst diff --git a/docs/source/exit_codes.rst b/docs/source/exit_codes.rst new file mode 100644 index 000000000000..bd35e654530e --- /dev/null +++ b/docs/source/exit_codes.rst @@ -0,0 +1,20 @@ +.. _exit-codes: + +Exit codes +=========== + +Mypy, like all programs, returns an +`exit code `_ to the process or shell +that invokes it. The meaning of these codes is thus: + +* 0: no type errors + +* 1: there are some type errors + +* 2: a crash, bad arguments, and other non-standard conditions relating to mypy + +There is currently `a bug `_ +in which certain configuration errors will result in an exit code of 0 instead +of 2. + +Note: the exit code is completely unrelated to mypy-internal :ref:`error-codes`. From a369c2463a808537152f6951186a031c3da5a513 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Thu, 31 Jul 2025 01:35:16 -0400 Subject: [PATCH 3/3] Update exit_codes.rst: mention configuration explicitly --- docs/source/exit_codes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/exit_codes.rst b/docs/source/exit_codes.rst index bd35e654530e..01cc08113254 100644 --- a/docs/source/exit_codes.rst +++ b/docs/source/exit_codes.rst @@ -11,7 +11,7 @@ that invokes it. The meaning of these codes is thus: * 1: there are some type errors -* 2: a crash, bad arguments, and other non-standard conditions relating to mypy +* 2: a crash, bad arguments or configuration, and other non-standard conditions relating to mypy There is currently `a bug `_ in which certain configuration errors will result in an exit code of 0 instead