Skip to content

Commit 96bc974

Browse files
committed
chore: big reformatting
1 parent 8d9318d commit 96bc974

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3
-230
lines changed

robotcode/debugger/__main__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
__file__ = __file__[:-1]
2727

2828
if __name__ == "__main__" and __package__ is None or __package__ == "":
29-
3029
file = Path(__file__).resolve()
3130
parent, top = file.parent, file.parents[2]
3231

@@ -114,7 +113,6 @@ async def start_debugpy_async(
114113
global config_done_callback
115114

116115
def connect_debugpy(server: "DebugAdapterServer") -> None:
117-
118116
server.protocol.send_event(Event(event="debugpyStarted", body={"port": port, "addresses": addresses}))
119117

120118
if wait_for_debugpy_client:
@@ -206,7 +204,6 @@ async def run_robot(
206204

207205
exit_code = -1
208206
try:
209-
210207
exit_code = robot.run_cli(args, False)
211208
finally:
212209
if server.protocol.connected:

robotcode/debugger/debugger.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ def set_breakpoints(
424424
lines: Optional[List[int]] = None,
425425
source_modified: Optional[bool] = None,
426426
) -> List[Breakpoint]:
427-
428427
if self.is_windows_path(source.path or ""):
429428
path: pathlib.PurePath = pathlib.PureWindowsPath(source.path or "")
430429
else:
@@ -930,7 +929,6 @@ def map_path_to_client(self, path: Union[os.PathLike[str], str]) -> pathlib.Pure
930929
return path
931930

932931
for mapping in self.path_mappings:
933-
934932
remote_root_path = Path(mapping.remote_root or ".").absolute()
935933

936934
if (

robotcode/debugger/launcher/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
__file__ = __file__[:-1]
1313

1414
if __name__ == "__main__" and __package__ is None or __package__ == "":
15-
1615
file = Path(__file__).resolve()
1716
parent, top = file.parent, file.parents[3]
1817

robotcode/debugger/listeners.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def start_suite(self, name: str, attributes: Dict[str, Any]) -> None:
4141
Debugger.instance().start_suite(name, attributes)
4242

4343
def end_suite(self, name: str, attributes: Dict[str, Any]) -> None:
44-
4544
Debugger.instance().end_suite(name, attributes)
4645

4746
Debugger.instance().end_output_group(name, attributes, "SUITE")

robotcode/debugger/protocol.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def __init__(
7575

7676

7777
class DebugAdapterProtocol(JsonRPCProtocolBase):
78-
7978
_logger = LoggingDescriptor()
8079

8180
def __init__(self) -> None:
@@ -301,7 +300,6 @@ def send_request(
301300
request: Request,
302301
return_type: Optional[Type[TResult]] = None,
303302
) -> asyncio.Future[TResult]:
304-
305303
result: asyncio.Future[TResult] = asyncio.get_event_loop().create_future()
306304

307305
with self._sended_request_lock:

robotcode/debugger/server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ async def _terminate(self, arguments: Optional[TerminateArguments] = None, *args
233233

234234
@rpc_method(name="disconnect", param_type=DisconnectArguments)
235235
async def _disconnect(self, arguments: Optional[DisconnectArguments] = None, *args: Any, **kwargs: Any) -> None:
236-
237236
if (
238237
(not (await self.exited) or not (await self.terminated))
239238
and arguments is not None
@@ -264,7 +263,6 @@ async def _configuration_done(
264263
self._received_configuration_done_event.set()
265264

266265
if self.received_configuration_done_callback is not None:
267-
268266
self.received_configuration_done_callback()
269267

270268
@_logger.call

robotcode/jsonrpc2/protocol.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def rpc_method(
180180
cancelable: bool = True,
181181
) -> Callable[[_F], _F]:
182182
def _decorator(func: _F) -> Callable[[_F], _F]:
183-
184183
if inspect.isclass(_func):
185184
raise TypeError(f"Not supported type {type(func)}.")
186185

@@ -270,7 +269,6 @@ def get_methods(obj: Any) -> Dict[str, RpcMethodEntry]:
270269
}
271270

272271
if not self.__initialized:
273-
274272
if inspect.isclass(self.__owner):
275273
self.__methods = get_methods(self.__owner)
276274

@@ -342,7 +340,6 @@ class ReceivedRequestEntry(NamedTuple):
342340

343341

344342
class JsonRPCProtocolBase(asyncio.Protocol, ABC):
345-
346343
_logger = LoggingDescriptor()
347344
registry: ClassVar = RpcRegistry()
348345

@@ -547,7 +544,6 @@ def send_request(
547544
params: Optional[Any] = None,
548545
return_type_or_converter: Optional[Type[_TResult]] = None,
549546
) -> asyncio.Future[Optional[_TResult]]:
550-
551547
with self._sended_request_lock:
552548
result: asyncio.Future[Optional[_TResult]] = create_sub_future()
553549
self._sended_request_count += 1
@@ -566,7 +562,6 @@ async def send_request_async(
566562
params: Optional[Any] = None,
567563
return_type: Optional[Type[_TResult]] = None,
568564
) -> Optional[_TResult]:
569-
570565
return await self.send_request(method, params, return_type)
571566

572567
@_logger.call
@@ -613,7 +608,6 @@ def set_result(f: asyncio.Future[Any], r: Any, ev: threading.Event) -> None:
613608

614609
start = time.monotonic()
615610
while not done.is_set():
616-
617611
if time.monotonic() - start > 120:
618612
raise TimeoutError("Can't set future result.")
619613

robotcode/language_server/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
__file__ = __file__[:-1]
1414

1515
if __name__ == "__main__" and __package__ is None or __package__ == "":
16-
1716
file = Path(__file__).resolve()
1817
parent, top = file.parent, file.parents[2]
1918

robotcode/language_server/common/parts/code_action.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929

3030
class CodeActionProtocolPart(LanguageServerProtocolPart, HasExtendCapabilities):
31-
3231
_logger = LoggingDescriptor()
3332

3433
def __init__(self, parent: LanguageServerProtocol) -> None:
@@ -71,7 +70,6 @@ async def _text_document_code_action(
7170
*args: Any,
7271
**kwargs: Any,
7372
) -> Optional[List[Union[Command, CodeAction]]]:
74-
7573
results: List[Union[Command, CodeAction]] = []
7674

7775
document = await self.parent.documents.get(text_document.uri)
@@ -105,7 +103,6 @@ async def _text_document_code_action_resolve(
105103
*args: Any,
106104
**kwargs: Any,
107105
) -> CodeAction:
108-
109106
results: List[CodeAction] = []
110107

111108
for result in await self.resolve(self, params):

robotcode/language_server/common/parts/code_lens.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626

2727
class CodeLensProtocolPart(LanguageServerProtocolPart, HasExtendCapabilities):
28-
2928
_logger = LoggingDescriptor()
3029

3130
def __init__(self, parent: LanguageServerProtocol) -> None:
@@ -49,7 +48,6 @@ def extend_capabilities(self, capabilities: ServerCapabilities) -> None:
4948
async def _text_document_code_lens(
5049
self, text_document: TextDocumentIdentifier, *args: Any, **kwargs: Any
5150
) -> Optional[List[CodeLens]]:
52-
5351
results: List[CodeLens] = []
5452
document = await self.parent.documents.get(text_document.uri)
5553
if document is None:
@@ -71,7 +69,6 @@ async def _text_document_code_lens(
7169
@rpc_method(name="codeLens/resolve", param_type=CodeLens)
7270
@threaded()
7371
async def _code_lens_resolve(self, params: CodeLens, *args: Any, **kwargs: Any) -> CodeLens:
74-
7572
results: List[CodeLens] = []
7673

7774
for result in await self.resolve(self, params):

0 commit comments

Comments
 (0)