From 014986c1ca6df313e547d65f0bbb7f90649848e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kotori=E3=81=AE=E3=81=AD=E3=81=93?= Date: Mon, 6 Nov 2023 03:10:47 -0500 Subject: [PATCH] :sparkles: Fix linting issues --- core/services/devices/__init__.py | 2 +- plugins/genshin/daily_note.py | 1 - plugins/genshin/player_cards.py | 2 +- utils/models/lock.py | 4 ++-- utils/typedefs/_queue.py | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/services/devices/__init__.py b/core/services/devices/__init__.py index 45296b9e..5e1937a2 100644 --- a/core/services/devices/__init__.py +++ b/core/services/devices/__init__.py @@ -2,4 +2,4 @@ from core.services.devices.services import DevicesService -__all__ = "DevicesService" +__all__ = ("DevicesService",) diff --git a/plugins/genshin/daily_note.py b/plugins/genshin/daily_note.py index ea517554..d53495c2 100644 --- a/plugins/genshin/daily_note.py +++ b/plugins/genshin/daily_note.py @@ -1,4 +1,3 @@ -import datetime from datetime import datetime from typing import Optional, TYPE_CHECKING diff --git a/plugins/genshin/player_cards.py b/plugins/genshin/player_cards.py index 6374ed68..ed1e2ca0 100644 --- a/plugins/genshin/player_cards.py +++ b/plugins/genshin/player_cards.py @@ -47,7 +47,7 @@ try: from python_genshin_artifact.models.skill import SkillInfo GENSHIN_ARTIFACT_FUNCTION_AVAILABLE = True -except ImportError as exc: +except ImportError: get_damage_analysis = None get_transformative_damage = None enka_parser = None diff --git a/utils/models/lock.py b/utils/models/lock.py index e8e39fb8..5ae2bfce 100644 --- a/utils/models/lock.py +++ b/utils/models/lock.py @@ -10,7 +10,7 @@ __all__ = ("HashLock",) _lock: "LockType" = Lock() _locks: Dict[int, "LockType"] = {} -_clean_lock_task_map: Dict[int, Task] +_clean_lock_task_map: Dict[int, Task] = {} async def delete_lock(target: int) -> None: @@ -42,7 +42,7 @@ class HashLock: target = hash(target) self.target = target - def __enter__(self) -> None: + def __enter__(self) -> bool: # noinspection PyTypeChecker return self.lock.__enter__() diff --git a/utils/typedefs/_queue.py b/utils/typedefs/_queue.py index 9d6c81f6..45172af8 100644 --- a/utils/typedefs/_queue.py +++ b/utils/typedefs/_queue.py @@ -1,5 +1,5 @@ # pylint: disable=W0049 -from typing import NoReturn, Optional, Protocol, TypeVar +from typing import Optional, Protocol, TypeVar __all__ = ["BaseQueue", "SyncQueue", "AsyncQueue"]