Skip to content

Commit 2db915c

Browse files
committed
Ruff format
1 parent f422141 commit 2db915c

26 files changed

+1106
-639
lines changed

pyproject.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ description = "MCPM - Model Context Protocol Manager"
99
readme = "README.md"
1010
requires-python = ">=3.8"
1111
license = "MIT"
12-
authors = [
13-
{name = "MCPM Contributors"},
14-
]
12+
authors = [{ name = "MCPM Contributors" }]
1513
dependencies = [
1614
"click>=8.1.3",
1715
"rich>=12.0.0",
@@ -36,3 +34,11 @@ path = "src/mcpm/version.py"
3634

3735
[tool.pytest.ini_options]
3836
testpaths = ["tests"]
37+
38+
[tool.ruff]
39+
line-length = 120
40+
fix = true
41+
42+
[tool.ruff.lint]
43+
select = ["F", "E", "W", "I"]
44+
fixable = ["I", "F401"]

src/mcpm/cli.py

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929

3030

3131
@click.group(context_settings=CONTEXT_SETTINGS, invoke_without_command=True)
32-
@click.option(
33-
"-h", "--help", "help_flag", is_flag=True, help="Show this message and exit."
34-
)
32+
@click.option("-h", "--help", "help_flag", is_flag=True, help="Show this message and exit.")
3533
@click.version_option(version=__version__)
3634
@click.pass_context
3735
def main(ctx, help_flag):
@@ -45,9 +43,7 @@ def main(ctx, help_flag):
4543
active_client = config_manager.get_active_client()
4644
if not active_client:
4745
console.print("[bold red]Error:[/] No active client set.")
48-
console.print(
49-
"Please run 'mcpm client <client-name>' to set an active client."
50-
)
46+
console.print("Please run 'mcpm client <client-name>' to set an active client.")
5147
console.print("Available clients:")
5248

5349
# Show available clients
@@ -100,28 +96,16 @@ def main(ctx, help_flag):
10096

10197
# Display active client information and main help
10298
if active_client:
103-
client_status = (
104-
"[green]✓[/]"
105-
if installed_clients.get(active_client, False)
106-
else "[yellow]⚠[/]"
107-
)
108-
console.print(
109-
f"[bold magenta]Active client:[/] [yellow]{active_client}[/] {client_status}"
110-
)
99+
client_status = "[green]✓[/]" if installed_clients.get(active_client, False) else "[yellow]⚠[/]"
100+
console.print(f"[bold magenta]Active client:[/] [yellow]{active_client}[/] {client_status}")
111101
else:
112-
console.print(
113-
"[bold red]No active client set![/] Please run 'mcpm client <client-name>' to set one."
114-
)
102+
console.print("[bold red]No active client set![/] Please run 'mcpm client <client-name>' to set one.")
115103
console.print("")
116104

117105
# Display usage info
118-
console.print(
119-
"[bold green]Usage:[/] [white]mcpm [OPTIONS] COMMAND [ARGS]...[/]"
120-
)
106+
console.print("[bold green]Usage:[/] [white]mcpm [OPTIONS] COMMAND [ARGS]...[/]")
121107
console.print("")
122-
console.print(
123-
"[bold green]Description:[/] [white]A tool for managing MCP servers across various clients.[/]"
124-
)
108+
console.print("[bold green]Description:[/] [white]A tool for managing MCP servers across various clients.[/]")
125109
console.print("")
126110

127111
# Display options
@@ -133,34 +117,24 @@ def main(ctx, help_flag):
133117
# Display available commands in a table
134118
console.print("[bold]Commands:[/]")
135119
commands_table = Table(show_header=False, box=None, padding=(0, 2, 0, 0))
136-
commands_table.add_row(
137-
" [cyan]add[/]", "Add an MCP server directly to a client."
138-
)
120+
commands_table.add_row(" [cyan]add[/]", "Add an MCP server directly to a client.")
139121
commands_table.add_row(" [cyan]client[/]", "Manage the active MCPM client.")
140122
commands_table.add_row(" [cyan]config[/]", "Manage MCPM configuration.")
141123
commands_table.add_row(
142124
" [cyan]edit[/]",
143125
"View or edit the active MCPM client's configuration file.",
144126
)
145-
commands_table.add_row(
146-
" [cyan]inspector[/]", "Launch the MCPM Inspector UI to examine servers."
147-
)
127+
commands_table.add_row(" [cyan]inspector[/]", "Launch the MCPM Inspector UI to examine servers.")
148128
commands_table.add_row(" [cyan]list[/]", "List all installed MCP servers.")
149129
commands_table.add_row(" [cyan]remove[/]", "Remove an installed MCP server.")
150130
commands_table.add_row(" [cyan]search[/]", "Search available MCP servers.")
151-
commands_table.add_row(
152-
" [cyan]stash[/]", "Temporarily store a server configuration aside."
153-
)
154-
commands_table.add_row(
155-
" [cyan]pop[/]", "Restore a previously stashed server configuration."
156-
)
131+
commands_table.add_row(" [cyan]stash[/]", "Temporarily store a server configuration aside.")
132+
commands_table.add_row(" [cyan]pop[/]", "Restore a previously stashed server configuration.")
157133
console.print(commands_table)
158134

159135
# Additional helpful information
160136
console.print("")
161-
console.print(
162-
"[italic]Run [bold]mcpm CLIENT -h[/] for more information on a command.[/]"
163-
)
137+
console.print("[italic]Run [bold]mcpm CLIENT -h[/] for more information on a command.[/]")
164138

165139

166140
# Register commands

src/mcpm/clients/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,4 @@
77
from mcpm.clients.windsurf import WindsurfManager
88
from mcpm.clients.cursor import CursorManager
99

10-
__all__ = [
11-
'BaseClientManager',
12-
'ClaudeDesktopManager',
13-
'WindsurfManager',
14-
'CursorManager'
15-
]
10+
__all__ = ["BaseClientManager", "ClaudeDesktopManager", "WindsurfManager", "CursorManager"]

0 commit comments

Comments
 (0)