Updated pyproject.toml, black+mypy

This commit is contained in:
Casey 2023-05-10 09:19:22 +03:00
parent 8d5a8fd424
commit 76b2241a82
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
3 changed files with 14 additions and 9 deletions

View File

@ -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()

View File

@ -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

View File

@ -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