From af957c18fe34dc92cb91774faaec5808692c7ea1 Mon Sep 17 00:00:00 2001 From: Alena Volkova Date: Tue, 10 Oct 2017 00:22:37 -0400 Subject: [PATCH] mypy: zulip: Annotate integrations/git/zulip_git_config.py. --- tools/run-mypy | 1 - zulip/integrations/git/zulip_git_config.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/run-mypy b/tools/run-mypy index b7baae3..cafb267 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -19,7 +19,6 @@ os.chdir(os.path.dirname(TOOLS_DIR)) sys.path.append(os.path.dirname(TOOLS_DIR)) exclude = """ -zulip/integrations/git/zulip_git_config.py zulip/integrations/irc/irc_mirror_backend.py zulip/integrations/log2zulip/log2zulip zulip/integrations/perforce/zulip_perforce_config.py diff --git a/zulip/integrations/git/zulip_git_config.py b/zulip/integrations/git/zulip_git_config.py index e1c0ca8..4f49297 100644 --- a/zulip/integrations/git/zulip_git_config.py +++ b/zulip/integrations/git/zulip_git_config.py @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +from typing import Dict, Text # Change these values to configure authentication for the plugin ZULIP_USER = "git-bot@example.com" @@ -41,6 +42,7 @@ ZULIP_API_KEY = "0123456789abcdef0123456789abcdef" # * topic "master" # And similarly for branch "test-post-receive" (for use when testing). def commit_notice_destination(repo, branch, commit): + # type: (Text, Text, Text) -> Dict[Text, Text] if branch in ["master", "test-post-receive"]: return dict(stream = "commits", subject = u"%s" % (branch,)) @@ -54,6 +56,7 @@ def commit_notice_destination(repo, branch, commit): # # return '!avatar(%s) [%s](https://example.com/commits/%s)\n' % (author, subject, commit_id) def format_commit_message(author, subject, commit_id): + # type: (Text, Text, Text) -> Text return '!avatar(%s) %s\n' % (author, subject) ## If properly installed, the Zulip API should be in your import