From afca7f2f70add4531ad2b4c6dbff62686106a8b4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:52:29 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.16.0 → v3.17.0](https://github.com/asottile/pyupgrade/compare/v3.16.0...v3.17.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 457a484..8952342 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + rev: v3.17.0 hooks: - id: pyupgrade args: [--py310-plus] From 908806b032df6322c5123d3c41cd38144c1098f7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:52:41 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- bot/main.py | 4 ++-- bot/parse_message.py | 2 +- bot/util.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/main.py b/bot/main.py index a5aef9d..e33fd8d 100644 --- a/bot/main.py +++ b/bot/main.py @@ -74,7 +74,7 @@ async def connect( config: Config, *, quiet: bool, -) -> tuple[AsyncGenerator[bytes, None], asyncio.StreamWriter]: +) -> tuple[AsyncGenerator[bytes], asyncio.StreamWriter]: async def _new_conn() -> tuple[asyncio.StreamReader, asyncio.StreamWriter]: reader, writer = await asyncio.open_connection(HOST, PORT, ssl=True) @@ -95,7 +95,7 @@ async def _new_conn() -> tuple[asyncio.StreamReader, asyncio.StreamWriter]: reader, writer = await _new_conn() - async def next_line() -> AsyncGenerator[bytes, None]: + async def next_line() -> AsyncGenerator[bytes]: nonlocal reader, writer while not writer.is_closing(): diff --git a/bot/parse_message.py b/bot/parse_message.py index f8d1815..25f0c8c 100644 --- a/bot/parse_message.py +++ b/bot/parse_message.py @@ -38,7 +38,7 @@ def _replace_cheer( s: str, cheer_info: Mapping[str, CheerInfo], cheer_regex: re.Pattern[str], -) -> Generator[str | Emote | Cheer, None, None]: +) -> Generator[str | Emote | Cheer]: pos = 0 for match in cheer_regex.finditer(s): yield s[pos:match.start()] diff --git a/bot/util.py b/bot/util.py index b51c0d0..102cdbc 100644 --- a/bot/util.py +++ b/bot/util.py @@ -30,7 +30,7 @@ def seconds_to_readable(seconds: int) -> str: @contextlib.contextmanager -def atomic_open(filename: str) -> Generator[IO[bytes], None, None]: +def atomic_open(filename: str) -> Generator[IO[bytes]]: fd, fname = tempfile.mkstemp(dir=os.path.dirname(filename)) try: with open(fd, 'wb') as f: