diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c615ac..deb7711 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,11 +15,11 @@ repos: - --diff - --check - repo: https://github.com/PyCQA/flake8 - rev: 7.1.1 + rev: 7.2.0 hooks: - id: flake8 - repo: https://github.com/PyCQA/pylint - rev: v3.3.4 + rev: v3.3.6 hooks: - id: pylint args: @@ -33,7 +33,7 @@ repos: - gql[aiohttp]~=3.5.0 - async-lru~=1.0.3 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.14.1 + rev: v1.15.0 hooks: - id: mypy additional_dependencies: @@ -51,7 +51,7 @@ repos: args: - --py36-plus - repo: https://github.com/pycqa/isort - rev: 6.0.0 + rev: 6.0.1 hooks: - id: isort name: isort diff --git a/components/callbacks.py b/components/callbacks.py index b71b1b9..94f2e8a 100644 --- a/components/callbacks.py +++ b/components/callbacks.py @@ -7,8 +7,9 @@ import re import time from collections import deque +from collections.abc import MutableSequence, Sequence from copy import deepcopy -from typing import Dict, List, Match, Tuple, cast +from typing import Dict, List, Match, Optional, Tuple, cast from httpx import codes from telegram import ( @@ -323,7 +324,7 @@ async def tag_hint(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: first_match = cast(int, MessageLimit.MAX_TEXT_LENGTH) messages = [] - buttons = None + buttons: Optional[MutableSequence[Sequence[InlineKeyboardButton]]] = None for match in cast(List[Match], context.matches): first_match = min(first_match, match.start(0))