Skip to content

Commit

Permalink
chore(lint): format code
Browse files Browse the repository at this point in the history
  • Loading branch information
HsiangNianian committed Mar 2, 2024
1 parent 4314aa9 commit 1ae75c8
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 1,246 deletions.
12 changes: 6 additions & 6 deletions iamai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
This Module imports the following contents from the sub-module.
"""

from iamai.adapter import Adapter
from iamai.bot import Bot
from iamai.config import ConfigModel
from iamai.dependencies import Depends
from iamai.event import Event, MessageEvent
from iamai.plugin import Plugin
from .adapter import Adapter
from .bot import Bot
from .config import ConfigModel
from .dependencies import Depends
from .event import Event, MessageEvent
from .plugin import Plugin

__all__ = [
"Adapter",
Expand Down
8 changes: 4 additions & 4 deletions iamai/adapter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
overload,
)

from iamai.event import Event
from iamai.typing import ConfigT, EventT
from iamai.utils import is_config_class
from ..event import Event
from ..typing import ConfigT, EventT
from ..utils import is_config_class

if TYPE_CHECKING:
from iamai.bot import Bot
from ..bot import Bot

__all__ = ["Adapter"]

Expand Down
6 changes: 3 additions & 3 deletions iamai/adapter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import aiohttp
from aiohttp import web

from iamai.adapter import Adapter
from iamai.log import logger
from iamai.typing import ConfigT, EventT
from ..adapter import Adapter
from ..log import logger
from ..typing import ConfigT, EventT

__all__ = [
"PollingAdapter",
Expand Down
18 changes: 9 additions & 9 deletions iamai/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@

from pydantic import ValidationError, create_model

from iamai.adapter import Adapter
from iamai.config import AdapterConfig, ConfigModel, MainConfig, PluginConfig
from iamai.dependencies import solve_dependencies
from iamai.event import Event
from iamai.exceptions import (
from .adapter import Adapter
from .config import AdapterConfig, ConfigModel, MainConfig, PluginConfig
from .dependencies import solve_dependencies
from .event import Event
from .exceptions import (
GetEventTimeout,
LoadModuleError,
SkipException,
StopException,
)
from iamai.log import logger
from iamai.plugin import Plugin, PluginLoadType
from iamai.typing import AdapterHook, AdapterT, BotHook, EventHook, EventT
from iamai.utils import (
from .log import logger
from .plugin import Plugin, PluginLoadType
from .typing import AdapterHook, AdapterT, BotHook, EventHook, EventT
from .utils import (
ModulePathFinder,
get_classes_from_module_name,
is_config_class,
Expand Down
2 changes: 1 addition & 1 deletion iamai/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def plugin(install, search, uninstall):
if not os.path.exists(config_path):
click.echo(
click.style(
f"Error: 'config.toml' not found. Use 'iamai new' command first.",
"Error: 'config.toml' not found. Use 'iamai new' command first.",
fg="red",
)
)
Expand Down
2 changes: 1 addition & 1 deletion iamai/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
cast,
)

from iamai.utils import get_annotations, sync_ctx_manager_wrapper
from .utils import get_annotations, sync_ctx_manager_wrapper

_T = TypeVar("_T")
Dependency = Union[
Expand Down
2 changes: 1 addition & 1 deletion iamai/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from pydantic import BaseModel, ConfigDict

from iamai.typing import AdapterT
from .typing import AdapterT

__all__ = ["Event", "MessageEvent"]

Expand Down
14 changes: 7 additions & 7 deletions iamai/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
)
from typing_extensions import Annotated, get_args, get_origin

from iamai.config import ConfigModel
from iamai.dependencies import Depends
from iamai.event import Event
from iamai.exceptions import SkipException, StopException
from iamai.typing import ConfigT, EventT, StateT
from iamai.utils import is_config_class
from .config import ConfigModel
from .dependencies import Depends
from .event import Event
from .exceptions import SkipException, StopException
from .typing import ConfigT, EventT, StateT
from .utils import is_config_class

if TYPE_CHECKING:
from iamai.bot import Bot
from .bot import Bot

__all__ = ["Plugin", "PluginLoadType"]

Expand Down
12 changes: 6 additions & 6 deletions iamai/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
# ruff: noqa: TCH001
from typing import TYPE_CHECKING, Awaitable, Callable, Optional, TypeVar

from iamai.message import BuildMessageType, MessageSegmentT, MessageT
from .message import BuildMessageType, MessageSegmentT, MessageT

if TYPE_CHECKING:
from typing import Any

from iamai.adapter import Adapter
from iamai.bot import Bot
from iamai.config import ConfigModel
from iamai.event import Event
from iamai.plugin import Plugin
from .adapter import Adapter
from .bot import Bot
from .config import ConfigModel
from .event import Event
from .plugin import Plugin

__all__ = [
"StateT",
Expand Down
4 changes: 2 additions & 2 deletions iamai/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

from pydantic import BaseModel

from iamai.config import ConfigModel
from iamai.typing import EventT
from .config import ConfigModel
from .typing import EventT

if TYPE_CHECKING:
from os import PathLike
Expand Down
Loading

0 comments on commit 1ae75c8

Please sign in to comment.