Skip to content
Draft
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
20 changes: 20 additions & 0 deletions docs/source/exit_codes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. _exit-codes:

Exit codes
===========

Mypy, like all programs, returns an
`exit code <https://en.wikipedia.org/wiki/Exit_status>`_ 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 or configuration, and other non-standard conditions relating to mypy

There is currently `a bug <https://github.com/python/mypy/issues/19548>`_
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is definitely a good idea to be explicit about exit codes, but let's agree on them first. I added a few observations in #19548, this test is inaccurate as written, and I doubt documenting that would be helpful...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Contents
error_codes
error_code_list
error_code_list2
exit_codes
additional_features
faq
changelog
Expand Down