Skip to content

Commit 19a2632

Browse files
committed
refactor: switch lint environment to python 3.10 and corrected all linting errors and warnings
1 parent d7f3c23 commit 19a2632

File tree

19 files changed

+28
-28
lines changed

19 files changed

+28
-28
lines changed

bundled_requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ pluggy>=1.0.0
44
tomli>=2.0.0
55
tomli_w>=1.0.0
66
platformdirs>=3.2.0,<4.4.0
7-
colorama>=0.4.6
8-
websockets>=15.0
7+
colorama>=0.4.6

packages/core/src/robotcode/core/event.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ def __iter__(self) -> Iterator[Callable[_TParams, _TResult]]:
7272

7373
def _notify(
7474
self,
75-
*__args: _TParams.args,
75+
*__args: Any,
7676
return_exceptions: Optional[bool] = True,
7777
callback_filter: Optional[Callable[[Callable[..., Any]], bool]] = None,
78-
**__kwargs: _TParams.kwargs,
78+
**__kwargs: Any,
7979
) -> Iterator[Union[_TResult, BaseException]]:
8080
for method in filter(
8181
lambda x: callback_filter(x) if callback_filter is not None else True,
@@ -95,19 +95,19 @@ def _notify(
9595
class EventIterator(EventResultIteratorBase[_TParams, _TResult]):
9696
def __call__(
9797
self,
98-
*__args: _TParams.args,
98+
*__args: Any,
9999
callback_filter: Optional[Callable[[Callable[..., Any]], bool]] = None,
100-
**__kwargs: _TParams.kwargs,
100+
**__kwargs: Any,
101101
) -> Iterator[Union[_TResult, BaseException]]:
102102
return self._notify(*__args, callback_filter=callback_filter, **__kwargs)
103103

104104

105105
class Event(EventResultIteratorBase[_TParams, _TResult]):
106106
def __call__(
107107
self,
108-
*__args: _TParams.args,
108+
*__args: Any,
109109
callback_filter: Optional[Callable[[Callable[..., Any]], bool]] = None,
110-
**__kwargs: _TParams.kwargs,
110+
**__kwargs: Any,
111111
) -> List[Union[_TResult, BaseException]]:
112112
return list(self._notify(*__args, callback_filter=callback_filter, **__kwargs))
113113

packages/core/src/robotcode/core/text_document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def cache_invalidated(sender) -> None: ...
226226
def _cache_invalidating(self) -> Iterator[None]:
227227
send_events = len(self._cache) > 0
228228
if send_events:
229-
self.cache_invalidate()
229+
self.cache_invalidate(self)
230230
try:
231231
with self._lock:
232232
yield

packages/core/src/robotcode/core/utils/dataclasses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def validate_types(expected_types: Union[type, Tuple[type, ...], None], value: A
647647
continue
648648

649649
if (
650-
t is Any # type: ignore
650+
t is Any
651651
or t is Ellipsis # type: ignore
652652
or isinstance(value, origin or t)
653653
or (
@@ -683,7 +683,7 @@ def validate_types(expected_types: Union[type, Tuple[type, ...], None], value: A
683683

684684
return []
685685

686-
if t is Any: # type: ignore
686+
if t is Any:
687687
return []
688688

689689
if isinstance(value, origin or t):

packages/core/src/robotcode/core/utils/inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def iter_methods(
1515
m = v
1616
else:
1717
m = getattr(obj, name)
18-
if not inspect.ismethod(m): # type: ignore
18+
if not inspect.ismethod(m):
1919
continue
2020

2121
if predicate is None or predicate(m):

packages/core/src/robotcode/core/utils/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def __init_logger(self) -> LoggingDescriptor:
136136

137137
if self.__func is not None:
138138
if isinstance(self.__func, staticmethod):
139-
returned_logger = self.__func.__func__() # type: ignore
139+
returned_logger = self.__func.__func__()
140140
else:
141141
returned_logger = self.__func()
142142

packages/core/src/robotcode/core/workspace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def get_configuration(
7676
section: Type[TConfig],
7777
scope_uri: Union[str, Uri, None] = None,
7878
) -> TConfig:
79-
result = self.settings
79+
result: Any = self.settings
8080
for sub_key in str(section).split("."):
8181
if sub_key in result:
8282
result = result.get(sub_key, None)

packages/debugger/src/robotcode/debugger/dap_types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,6 @@ class PauseResponse(Response):
801801
pass
802802

803803

804-
@dataclass
805804
class SteppingGranularity(Enum):
806805
STATEMENT = "statement"
807806
LINE = "line"

packages/jsonrpc2/src/robotcode/jsonrpc2/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def _decorator(func: _F) -> Callable[[_F], _F]:
196196
if isinstance(func, classmethod):
197197
f = func.__func__ # type: ignore
198198
elif isinstance(func, staticmethod):
199-
f = func.__func__ # type: ignore
199+
f = func.__func__
200200
else:
201201
f = func
202202

packages/jsonrpc2/src/robotcode/jsonrpc2/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from concurrent.futures import ThreadPoolExecutor
77
from types import TracebackType
88
from typing import (
9+
Any,
910
BinaryIO,
1011
Callable,
1112
Coroutine,
@@ -44,7 +45,7 @@ def close(self) -> None:
4445
self.rfile.close()
4546
self.wfile.close()
4647

47-
def write(self, data: bytes) -> None:
48+
def write(self, data: "bytes | bytearray | memoryview[Any]") -> None:
4849
self.wfile.write(data)
4950
self.wfile.flush()
5051

0 commit comments

Comments
 (0)