mypy: Add annotations for help.
MODIFY
tools/run-mypy
tools/run-mypy
@@ -44,6 +44,8 @@ force_include = [
"zulip_bots/zulip_bots/bots/github_detail/test_github_detail.py",
"zulip_bots/zulip_bots/bots/googlesearch/googlesearch.py",
"zulip_bots/zulip_bots/bots/googlesearch/test_googlesearch.py",
+ "zulip_bots/zulip_bots/bots/help/help.py",
+ "zulip_bots/zulip_bots/bots/help/test_help.py",
]
parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.")

MODIFY
zulip_bots/zulip_bots/bots/help/help.py
zulip_bots/zulip_bots/bots/help/help.py
# See readme.md for instructions on running this code.
+from typing import Any, Dict
class HelpHandler(object):
- def usage(self):
+ def usage(self: Any) -> str:
return '''
This plugin will give info about Zulip to
any user that types a message saying "help".
@@ -11,7 +12,7 @@ class HelpHandler(object):
your Zulip instance.
'''
- def handle_message(self, message, bot_handler):
+ def handle_message(self: Any, message: Dict[str, str], bot_handler: Any) -> None:
help_content = "Info on Zulip can be found here:\nhttps://github.com/zulip/zulip"
bot_handler.send_reply(message, help_content)

MODIFY
zulip_bots/zulip_bots/bots/help/test_help.py
zulip_bots/zulip_bots/bots/help/test_help.py
from zulip_bots.test_lib import StubBotTestCase
+from typing import Any
+
class TestHelpBot(StubBotTestCase):
bot_name = "help"
- def test_bot(self):
+ def test_bot(self: Any) -> None:
help_text = "Info on Zulip can be found here:\nhttps://github.com/zulip/zulip"
requests = ["", "help", "Hi, my name is abc"]

mypy: Add annotations for help.