Skip to content

Commit 34857c1

Browse files
fix: address verified release audit findings
Validated local candidate: 33b48f9efde1ecd6207aea0fca07cd6b4560bb2e - 33b48f9efde1ecd6207aea0fca07cd6b4560bb2e fix(cli): validate remove target and organize imports
1 parent 55776d1 commit 34857c1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/deadcode/cli.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
from __future__ import annotations
44

5-
import click
65
import json
76
import sys
87
from pathlib import Path
8+
9+
import click
910
from rich.console import Console
1011
from rich.table import Table
1112

@@ -178,6 +179,10 @@ def remove(ctx: click.Context, dry_run: bool, category: str | None) -> None:
178179
project = ctx.obj["project"]
179180
ignore = _merge_config_ignore(ctx)
180181

182+
if not Path(project).exists():
183+
err_console.print(f"[red]Project directory '{project}' not found.[/red]")
184+
sys.exit(1)
185+
181186
if not dry_run:
182187
console.print("[red]WARNING: This will modify files. Use --dry-run first![/red]")
183188
console.print("[dim]Press Ctrl+C to abort. Running in 3 seconds...[/dim]")

0 commit comments

Comments
 (0)