diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9a4ad1..0623e0a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,15 +6,15 @@ repos: # hooks: # - id: flake8 - repo: https://github.com/psf/black - rev: 22.1.0 + rev: 24.8.0 hooks: - id: black # - repo: https://github.com/pre-commit/mirrors-mypy # rev: 'v0.770' # hooks: # - id: mypy - - repo: https://github.com/asottile/reorder_python_imports - rev: v2.7.1 + - repo: https://github.com/asottile/reorder-python-imports + rev: v3.13.0 hooks: - id: reorder-python-imports # - repo: git@github.com:humitos/mirrors-autoflake.git diff --git a/examples/playground.py b/examples/playground.py index f2b8b10..6457752 100644 --- a/examples/playground.py +++ b/examples/playground.py @@ -34,9 +34,11 @@ async def main(): await client.send_message( "@TgIntegration", - "You did not reply :(" - if response.is_empty - else f"You replied with: {response.full_text}", + ( + "You did not reply :(" + if response.is_empty + else f"You replied with: {response.full_text}" + ), ) diff --git a/tgintegration/botcontroller.py b/tgintegration/botcontroller.py index 7d1fc2f..9a30f29 100644 --- a/tgintegration/botcontroller.py +++ b/tgintegration/botcontroller.py @@ -215,9 +215,9 @@ async def collect( timeouts=TimeoutSettings( max_wait=max_wait, wait_consecutive=wait_consecutive, - raise_on_timeout=raise_ - if raise_ is not None - else self.raise_no_response, + raise_on_timeout=( + raise_ if raise_ is not None else self.raise_no_response + ), ), ) as response: yield response diff --git a/tgintegration/update_recorder.py b/tgintegration/update_recorder.py index 96fdfe8..7703db6 100644 --- a/tgintegration/update_recorder.py +++ b/tgintegration/update_recorder.py @@ -29,7 +29,7 @@ async def record_message(self, _, message: Message): async with self._lock: message.exact_timestamp = time.time() self.messages.append(message) - for (pred, ev) in self._event_conditions: + for pred, ev in self._event_conditions: if pred(self.messages): ev.set()