Skip to content

Commit b4c08d3

Browse files
github-actions[bot]openhands-agentenyst
authored
fix(types): add -> None return type to __init__ methods (#742)
* fix(types): add -> None return type to __init__ methods Addresses item from code quality report. Co-authored-by: openhands <openhands@all-hands.dev> Closes #741 * fix: kick off CI for PR #742 Co-authored-by: openhands <openhands@all-hands.dev> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: enyst <engel.nyst@gmail.com>
1 parent 0b95396 commit b4c08d3

13 files changed

Lines changed: 19 additions & 17 deletions

openhands_cli/acp_impl/events/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(
4747
session_id: str,
4848
conn: "Client",
4949
conversation: BaseConversation | None = None,
50-
):
50+
) -> None:
5151
"""Initialize the event subscriber.
5252
5353
Args:

openhands_cli/acp_impl/events/token_streamer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(
7373
conn: Client,
7474
loop: asyncio.AbstractEventLoop,
7575
conversation: BaseConversation | None = None,
76-
):
76+
) -> None:
7777
self.session_id = session_id
7878
self.conn = conn
7979
self.loop = loop

openhands_cli/acp_impl/events/tool_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ToolCallState:
1818
returns True. Accessing them before raises ValueError.
1919
"""
2020

21-
def __init__(self, tool_call_id: str, tool_name: str):
21+
def __init__(self, tool_call_id: str, tool_name: str) -> None:
2222
self.tool_call_id = tool_call_id
2323
self.tool_name = tool_name
2424
self.is_think = tool_name == "think"

openhands_cli/acp_impl/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class UnbufferedJsonRpcReader:
3131
that can cause messages to get stuck in buffers.
3232
"""
3333

34-
def __init__(self, stdout):
34+
def __init__(self, stdout) -> None:
3535
self.stdout = stdout
3636
self.buffer = b""
3737
self.fd = stdout.fileno()

openhands_cli/tui/modals/confirmation_modal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(
3838
current_policy: ConfirmationPolicyBase,
3939
on_policy_selected: Callable[[ConfirmationPolicyBase], None],
4040
**kwargs,
41-
):
41+
) -> None:
4242
"""Initialize the confirmation settings modal.
4343
4444
Args:

openhands_cli/tui/modals/exit_modal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(
2424
on_exit_confirmed: Callable[[], None] | None = None,
2525
on_exit_cancelled: Callable[[], None] | None = None,
2626
**kwargs,
27-
):
27+
) -> None:
2828
"""Initialize the exit confirmation modal.
2929
3030
Args:

openhands_cli/tui/modals/settings/components/cli_settings_tab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(
2323
switch_id: str,
2424
value: bool = False,
2525
**kwargs,
26-
):
26+
) -> None:
2727
"""Initialize the settings switch.
2828
2929
Args:
@@ -49,7 +49,7 @@ def compose(self) -> ComposeResult:
4949
class CliSettingsTab(Container):
5050
"""CLI Settings tab component containing CLI-specific settings."""
5151

52-
def __init__(self, initial_settings: CliSettings | None = None, **kwargs):
52+
def __init__(self, initial_settings: CliSettings | None = None, **kwargs) -> None:
5353
"""Initialize the CLI settings tab.
5454
5555
Args:

openhands_cli/tui/modals/settings/components/critic_settings_tab.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(
4444
value: float,
4545
disabled: bool = False,
4646
**kwargs,
47-
):
47+
) -> None:
4848
"""Initialize the threshold input.
4949
5050
Args:
@@ -128,7 +128,9 @@ class CriticSettingsTab(Container):
128128
}
129129
"""
130130

131-
def __init__(self, initial_settings: CriticSettings | None = None, **kwargs):
131+
def __init__(
132+
self, initial_settings: CriticSettings | None = None, **kwargs
133+
) -> None:
132134
"""Initialize the Critic settings tab.
133135
134136
Args:

openhands_cli/tui/modals/settings/settings_screen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(
7575
on_first_time_settings_cancelled: Callable[[], None] | None = None,
7676
env_overrides_enabled: bool = False,
7777
**kwargs,
78-
):
78+
) -> None:
7979
"""Initialize the settings screen.
8080
8181
Args:

openhands_cli/tui/panels/confirmation_panel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class ConfirmationOption(Static):
1717
"""A confirmation option that shows > when highlighted."""
1818

19-
def __init__(self, label: str, **kwargs):
19+
def __init__(self, label: str, **kwargs) -> None:
2020
super().__init__(**kwargs)
2121
self.label = label
2222
self.is_highlighted = False
@@ -63,7 +63,7 @@ def __init__(
6363
self,
6464
num_actions: int,
6565
**kwargs,
66-
):
66+
) -> None:
6767
"""Initialize the inline confirmation panel.
6868
6969
Args:

0 commit comments

Comments
 (0)