From fe4c501ab63daa31ae402b4423b839a73d02141e Mon Sep 17 00:00:00 2001 From: Amir Rachum Date: Sun, 15 Oct 2023 10:34:47 +0300 Subject: [PATCH] mypy --- mypy.ini | 10 ++++++++++ src/spanreed/plugins/recurring_payments.py | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..3e19637 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,10 @@ +[mypy] +warn_return_any = True +warn_unused_configs = True +disallow_untyped_defs = True +disallow_incomplete_defs = True +check_untyped_defs = True +no_implicit_optional = True +strict_optional = True +warn_redundant_casts = True +warn_unused_ignores = True \ No newline at end of file diff --git a/src/spanreed/plugins/recurring_payments.py b/src/spanreed/plugins/recurring_payments.py index 0319b74..3ad3654 100644 --- a/src/spanreed/plugins/recurring_payments.py +++ b/src/spanreed/plugins/recurring_payments.py @@ -11,7 +11,7 @@ import yaml import jinja2 -from spanreed.apis.todoist import Todoist, Task +from spanreed.apis.todoist import Todoist, Task, Project from spanreed.plugins.todoist import TodoistPlugin from spanreed.apis.telegram_bot import TelegramBotApi from spanreed.apis.obsidian_webhook import ( @@ -51,7 +51,7 @@ class ObsidianLog: class RecurringPayment: todoist_label: str todoist_task_template: str - todoist_project_id: int + todoist_project_id: str date_format: str recurrence_cost: float recurrence_info: RecurrenceInfo @@ -141,7 +141,7 @@ async def ask_for_user_config(cls, user: User) -> None: "Please choose the project where you'd like to create the task:", [p.name for p in projects], ) - todoist_project_id = projects[todoist_project].id + todoist_project_id: str = projects[todoist_project].id recurrence_cost = float( await bot.request_user_input(