From a9e3fe9d0cac51ff71f5eaa10aac1d3aa02394f2 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 25 Oct 2023 16:21:34 -0700 Subject: [PATCH] zulip_trello: Add type annotations. Signed-off-by: Anders Kaseorg --- tools/run-mypy | 4 ---- zulip/integrations/trello/zulip_trello.py | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/run-mypy b/tools/run-mypy index a2733a19..ddd911e1 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -25,10 +25,6 @@ exclude = [ # Excluded out of laziness: "zulip_bots/zulip_bots/simple_lib.py", "zulip_bots/zulip_bots/tests/test_lib.py", - # Excluded because this is a self-contained script - # we ask our users to download and run directly and - # py2 and py3 compatibility is required. - "zulip/integrations/trello/zulip_trello.py", "tools", ] diff --git a/zulip/integrations/trello/zulip_trello.py b/zulip/integrations/trello/zulip_trello.py index eb1e7dde..e7a58de0 100755 --- a/zulip/integrations/trello/zulip_trello.py +++ b/zulip/integrations/trello/zulip_trello.py @@ -14,7 +14,7 @@ except ImportError: sys.exit(1) -def get_model_id(options): +def get_model_id(options: argparse.Namespace) -> str: """get_model_id Get Model Id from Trello API @@ -43,7 +43,7 @@ def get_model_id(options): return board_info_json["id"] -def get_webhook_id(options, id_model): +def get_webhook_id(options: argparse.Namespace, id_model: str) -> str: """get_webhook_id Get webhook id from Trello API @@ -78,7 +78,7 @@ def get_webhook_id(options, id_model): return webhook_info_json["id"] -def create_webhook(options): +def create_webhook(options: argparse.Namespace) -> None: """create_webhook Create Trello webhook @@ -107,7 +107,7 @@ def create_webhook(options): ) -def main(): +def main() -> None: description = """ zulip_trello.py is a handy little script that allows Zulip users to quickly set up a Trello webhook.