Skip to content

Commit a5fe801

Browse files
committed
Fix review comments
1 parent ed41f7b commit a5fe801

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

toolit/auto_loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def load_tools_from_plugins() -> list[FunctionType]:
5656
"""Discover and return plugin commands via entry points."""
5757
plugins = get_plugin_tools()
5858
for plugin in plugins:
59-
register_command(plugin, rich_help_panel=RichHelpPanelNames.NAME_OF_THE_RICH_GROUP_HELP_PANEL_PLUGINS)
59+
register_command(plugin, rich_help_panel=RichHelpPanelNames.PLUGINS_COMMANDS_PANEL)
6060
return plugins
6161

6262

@@ -83,7 +83,7 @@ def load_tools_from_folder(folder_path: pathlib.Path) -> list[FunctionType]:
8383
tool_groups: list[FunctionType] = get_items_from_folder(folder_path, tool_group_strategy)
8484
# Register each tool as a command
8585
for tool in tools:
86-
register_command(tool, rich_help_panel=RichHelpPanelNames.NAME_OF_THE_RICH_GROUP_HELP_PANEL_PROJECT)
86+
register_command(tool, rich_help_panel=RichHelpPanelNames.PROJECT_COMMANDS_PANEL)
8787
return tools + tool_groups
8888

8989

toolit/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
load_tools_from_folder(load_devtools_folder())
99
load_tools_from_plugins()
10-
register_command(create_vscode_tasks_json, rich_help_panel=RichHelpPanelNames.NAME_OF_THE_RICH_GROUP_HELP_PANEL_PLUGINS)
10+
register_command(create_vscode_tasks_json, rich_help_panel=RichHelpPanelNames.PLUGINS_COMMANDS_PANEL)
1111

1212

1313
if __name__ == "__main__":

toolit/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
class RichHelpPanelNames:
99
"""Namespace for the different rich help panel names."""
1010

11-
NAME_OF_THE_RICH_GROUP_HELP_PANEL_PROJECT = "Commands from Project"
12-
NAME_OF_THE_RICH_GROUP_HELP_PANEL_PLUGINS = "Commands from Plugins"
11+
PROJECT_COMMANDS_PANEL = "Commands from Project"
12+
PLUGINS_COMMANDS_PANEL = "Commands from Plugins"
1313

1414

1515
class ConfigFileKeys:

toolit/create_apps_and_register.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ def initialize() -> None:
2929
"""Welcome to the Toolit CLI."""
3030

3131

32-
def register_command(command_func: Callable[..., Any], name: str | None = None, rich_help_panel: str|None = None) -> None:
32+
def register_command(
33+
command_func: Callable[..., Any],
34+
name: str | None = None,
35+
rich_help_panel: str | None = None,
36+
) -> None:
3337
"""Register an external command to the CLI and MCP server if available."""
3438
if not callable(command_func):
3539
msg = f"Command function {command_func} is not callable."

0 commit comments

Comments
 (0)