Skip to content

Commit d584682

Browse files
committed
format files
1 parent 071b6c1 commit d584682

File tree

7 files changed

+23
-34
lines changed

7 files changed

+23
-34
lines changed

pybotx/async_buffer.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,22 @@ async def seek(
1313
self,
1414
cursor: int,
1515
whence: int = os.SEEK_SET,
16-
) -> int:
17-
...
16+
) -> int: ...
1817

19-
async def tell(self) -> int:
20-
...
18+
async def tell(self) -> int: ...
2119

2220

2321
class AsyncBufferWritable(AsyncBufferBase):
2422
@abc.abstractmethod
25-
async def write(self, content: bytes) -> int:
26-
...
23+
async def write(self, content: bytes) -> int: ...
2724

2825

2926
class AsyncBufferReadable(AsyncBufferBase):
3027
@abc.abstractmethod
3128
async def read(
3229
self,
3330
bytes_to_read: Optional[int] = None,
34-
) -> bytes:
35-
...
31+
) -> bytes: ...
3632

3733

3834
async def get_file_size(async_buffer: AsyncBufferReadable) -> int:

pybotx/bot/callbacks/callback_manager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,14 @@ def setup_callback_timeout_alarm(self, sync_id: UUID, timeout: float) -> None:
6969
def cancel_callback_timeout_alarm(
7070
self,
7171
sync_id: UUID,
72-
) -> None:
73-
... # noqa: WPS428, E704
72+
) -> None: ... # noqa: WPS428, E704
7473

7574
@overload
7675
def cancel_callback_timeout_alarm(
7776
self,
7877
sync_id: UUID,
7978
return_remaining_time: Literal[True],
80-
) -> float:
81-
... # noqa: WPS428, E704
79+
) -> float: ... # noqa: WPS428, E704
8280

8381
def cancel_callback_timeout_alarm(
8482
self,

pybotx/bot/callbacks/callback_repo_proto.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,22 @@ class CallbackRepoProto(Protocol):
1616
async def create_botx_method_callback(
1717
self,
1818
sync_id: UUID,
19-
) -> None:
20-
... # noqa: WPS428, E704
19+
) -> None: ... # noqa: WPS428, E704
2120

2221
async def set_botx_method_callback_result(
2322
self,
2423
callback: BotXMethodCallback,
25-
) -> None:
26-
... # noqa: WPS428, E704
24+
) -> None: ... # noqa: WPS428, E704
2725

2826
async def wait_botx_method_callback(
2927
self,
3028
sync_id: UUID,
3129
timeout: float,
32-
) -> BotXMethodCallback:
33-
... # noqa: WPS428, E704
30+
) -> BotXMethodCallback: ... # noqa: WPS428, E704
3431

3532
async def pop_botx_method_callback(
3633
self,
3734
sync_id: UUID,
38-
) -> "Future[BotXMethodCallback]":
39-
... # noqa: WPS428, E704
35+
) -> "Future[BotXMethodCallback]": ... # noqa: WPS428, E704
4036

4137
async def stop_callbacks_waiting(self) -> None: ... # noqa: WPS428, E704

pybotx/bot/handler_collector.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
if TYPE_CHECKING: # To avoid circular import
6060
from pybotx.bot.bot import Bot
6161

62+
MessageHandlerDecorator = Callable[
63+
[IncomingMessageHandlerFunc],
64+
IncomingMessageHandlerFunc,
65+
]
66+
6267

6368
class HandlerCollector:
6469
VALID_COMMAND_NAME_RE = re.compile(r"^\/[^\s\/]+$", flags=re.UNICODE)
@@ -194,16 +199,14 @@ def decorator(
194199
def default_message_handler(
195200
self,
196201
handler_func: IncomingMessageHandlerFunc,
197-
) -> IncomingMessageHandlerFunc:
198-
... # noqa: WPS428, E704
202+
) -> IncomingMessageHandlerFunc: ... # noqa: WPS428, E704
199203

200204
@overload
201205
def default_message_handler(
202206
self,
203207
*,
204208
middlewares: Optional[Sequence[Middleware]] = None,
205-
) -> Callable[[IncomingMessageHandlerFunc], IncomingMessageHandlerFunc]:
206-
... # noqa: WPS428, E704
209+
) -> MessageHandlerDecorator: ... # noqa: WPS428, E704
207210

208211
def default_message_handler( # noqa: WPS320
209212
self,

pybotx/models/enums.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,13 @@ def convert_chat_type_from_domain(chat_type: ChatTypes) -> APIChatTypes:
307307
@overload
308308
def convert_chat_type_to_domain(
309309
chat_type: APIChatTypes,
310-
) -> ChatTypes:
311-
... # noqa: WPS428, E704
310+
) -> ChatTypes: ... # noqa: WPS428, E704
312311

313312

314313
@overload
315314
def convert_chat_type_to_domain(
316315
chat_type: str,
317-
) -> UNSUPPORTED:
318-
... # noqa: WPS428, E704
316+
) -> UNSUPPORTED: ... # noqa: WPS428, E704
319317

320318

321319
def convert_chat_type_to_domain(
@@ -342,15 +340,13 @@ def convert_chat_type_to_domain(
342340
@overload
343341
def convert_sync_source_type_to_domain(
344342
sync_type: APISyncSourceTypes,
345-
) -> SyncSourceTypes:
346-
... # noqa: WPS428, E704
343+
) -> SyncSourceTypes: ... # noqa: WPS428, E704
347344

348345

349346
@overload
350347
def convert_sync_source_type_to_domain(
351348
sync_type: str,
352-
) -> UNSUPPORTED:
353-
... # noqa: WPS428, E704
349+
) -> UNSUPPORTED: ... # noqa: WPS428, E704
354350

355351

356352
def convert_sync_source_type_to_domain(

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ ignore =
137137
WPS603,
138138
# Forbidden `assert`
139139
S101,
140+
E704,
140141

141142

142143
[tool:pytest]

tests/test_handler_collector.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,6 @@ async def test__handler_collector__sync_smartapp_event__decorator__handler_alrea
562562
@collector.sync_smartapp_event
563563
async def duplicated_handle_sync_smartapp_event(
564564
*_: Any,
565-
) -> Any:
566-
... # noqa: E704
565+
) -> Any: ... # noqa: E704
567566

568567
assert str(exc.value) == "Handler for sync smartapp event already registered"

0 commit comments

Comments
 (0)