From d60a088a493bbdd10323fa80d3f43f5a8b9e67ce Mon Sep 17 00:00:00 2001 From: Jack Zhang Date: Tue, 9 Oct 2018 18:07:29 -0700 Subject: [PATCH] developer docs: Recommend the mypy daemon for running mypy locally. Resolves #10622. --- docs/contributing/mypy.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/contributing/mypy.md b/docs/contributing/mypy.md index 819ae52064..849e0b8180 100644 --- a/docs/contributing/mypy.md +++ b/docs/contributing/mypy.md @@ -110,11 +110,23 @@ requirements/mypy.txt`. ## Running mypy on Zulip's code locally -To run mypy on Zulip's python code, run the command: +To run mypy on Zulip's python code, you can run the command: tools/run-mypy -It will output errors in the same style as a compiler would. For +You can also run mypy as a long-running daemon (server) process and send +type-checking requests to the server via the command: + + tools/run-mypy -d + +While the mypy daemon is experimental and currently supports macOS and Linux +only, **we strongly recommend using the daemon** if it is an option. Program +state from previous runs will be cached in memory and will not have to be +read from the file system on each run. For a large codebase like Zulip's +and a workflow involving running mypy repeatedly after small edits, using +the daemon can be *10 or more times faster*. + +Mypy will output errors in the same style as a compiler would. For example, if your code has a type error like this: ```