From 76b2241a825bba98f55d3c9ade745ef8ab56cf7b Mon Sep 17 00:00:00 2001 From: hkc Date: Wed, 10 May 2023 09:19:22 +0300 Subject: [PATCH] Updated pyproject.toml, black+mypy --- mastoposter/__main__.py | 11 ++++------- mastoposter/integrations/discord/__init__.py | 3 +-- pyproject.toml | 9 +++++++++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/mastoposter/__main__.py b/mastoposter/__main__.py index 6fd395b..3e38fed 100644 --- a/mastoposter/__main__.py +++ b/mastoposter/__main__.py @@ -34,7 +34,7 @@ from mastoposter import ( execute_integrations, load_integrations_from, __version__, - __description__ + __description__, ) from mastoposter.integrations import FilteredIntegration from mastoposter.sources import websocket_source @@ -104,12 +104,9 @@ async def listen( def main(): - parser = ArgumentParser( - prog="mastoposter", - description=__description__ - ) - parser.add_argument("config", nargs="?", - default=getenv("MASTOPOSTER_CONFIG_FILE") + parser = ArgumentParser(prog="mastoposter", description=__description__) + parser.add_argument( + "config", nargs="?", default=getenv("MASTOPOSTER_CONFIG_FILE") ) parser.add_argument("-v", action="version", version=__version__) args = parser.parse_args() diff --git a/mastoposter/integrations/discord/__init__.py b/mastoposter/integrations/discord/__init__.py index 7bdef29..9572306 100644 --- a/mastoposter/integrations/discord/__init__.py +++ b/mastoposter/integrations/discord/__init__.py @@ -43,7 +43,7 @@ class DiscordIntegration(BaseIntegration): username: Optional[str] = None, avatar_url: Optional[str] = None, embeds: Optional[List[DiscordEmbed]] = None, - ) -> dict: + ) -> None: async with AsyncClient( transport=AsyncHTTPTransport(retries=self.retries) ) as c: @@ -65,7 +65,6 @@ class DiscordIntegration(BaseIntegration): ) ).json() logger.debug("Result: %r", result) - return result async def __call__(self, status: Status) -> Optional[str]: source = status.reblog or status diff --git a/pyproject.toml b/pyproject.toml index cd08aa1..2b8df30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,3 +35,12 @@ mastoposter = "mastoposter.__main__:main" [tool.flit.sdist] include = ["config.ini", "contrib/*"] + +[tool.black] +line-length = 79 +target-version = ['py37', 'py38'] + +[tool.mypy] +warn_return_any = true +warn_unused_configs = true +check_untyped_defs = true