Skip to content

Commit 290af43

Browse files
fix: apply ruff formatting to cli.py and test_cli.py by dev-engineer
1 parent efec87b commit 290af43

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

src/devforge/cli.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ def list_tools(
8282

8383
@app.command()
8484
def install(
85-
tool: str = typer.Argument(
86-
..., help="Tool to install: " + ", ".join(TOOLS.keys()) + ", or 'all'"
87-
),
85+
tool: str = typer.Argument(..., help="Tool to install: " + ", ".join(TOOLS.keys()) + ", or 'all'"),
8886
):
8987
"""Install a DevForge tool."""
9088
if tool == "all":
@@ -101,10 +99,7 @@ def install(
10199
pkg = f"devforge[{extras}]"
102100
console.print(f"[yellow]Installing {pkg}...[/yellow]")
103101
try:
104-
result = subprocess.run(
105-
[sys.executable, "-m", "pip", "install", pkg],
106-
capture_output=True, text=True
107-
)
102+
result = subprocess.run([sys.executable, "-m", "pip", "install", pkg], capture_output=True, text=True)
108103
if result.returncode == 0:
109104
console.print(f"[green]Successfully installed:[/green] {', '.join(targets)}")
110105
else:
@@ -130,8 +125,7 @@ def show_versions(
130125
info = TOOLS[t]
131126
try:
132127
result = subprocess.run(
133-
[sys.executable, "-m", "pip", "show", info["package"]],
134-
capture_output=True, text=True
128+
[sys.executable, "-m", "pip", "show", info["package"]], capture_output=True, text=True
135129
)
136130
if result.returncode == 0:
137131
for line in result.stdout.splitlines():

tests/test_cli.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for devforge meta-package."""
2+
23
from __future__ import annotations
34

45
from devforge import TOOLS, __version__
@@ -86,9 +87,7 @@ def test_versions_unknown_tool_fails(self):
8687
@mock.patch("devforge.cli.subprocess.run")
8788
def test_versions_specific_tool_not_installed(self, mock_run):
8889
"""Show 'not installed' for a tool that isn't installed."""
89-
mock_run.return_value = mock.MagicMock(
90-
returncode=1, stdout="", stderr=""
91-
)
90+
mock_run.return_value = mock.MagicMock(returncode=1, stdout="", stderr="")
9291
result = runner.invoke(app, ["versions", "guard"])
9392
assert result.exit_code == 0
9493
assert "guard" in result.stdout

0 commit comments

Comments
 (0)