Skip to content
Latchkey

mypy --error-summary: The Found N Errors Line

mypy --error-summary prints the closing line that tallies errors and files checked.

The summary line is what most pipelines grep for. It is on by default; knowing how to keep or drop it helps when parsing logs.

What it does

mypy --error-summary (the default) prints a final line such as "Found 3 errors in 2 files (checked 40 source files)" or "Success: no issues found in 40 source files". The exit code is 0 on success and 1 when errors are found, independent of the summary text.

Common usage

Terminal
mypy src/            # summary on by default
mypy --error-summary src/
# capture both the result line and the exit code
mypy src/; echo "exit=$?"

Options

FlagWhat it does
--error-summaryPrint the final tally line (default)
--no-error-summarySuppress the tally line
--prettyAdd source snippets and carets to each error
exit code 0 / 1 / 20 clean, 1 type errors, 2 a mypy/usage error

In CI

Gate the job on mypy exit code, not on grepping the summary string, because the wording differs across versions. Exit 2 means mypy itself failed (bad config, crash), which is different from exit 1 (type errors found); handle them distinctly if your pipeline distinguishes infra from code failures.

Common errors in CI

A pipeline that scrapes "Found N errors" breaks when a clean run prints "Success: no issues found" instead; rely on the exit code. An unexpected exit 2 with "error: Cannot find config file" or a traceback is a tooling problem, not a typing one.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →