Skip to content

Commit c9b9fca

Browse files
committed
improv mcp restart
1 parent b96bc0e commit c9b9fca

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/apx/cli/dev/commands.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Dev commands for the apx CLI."""
22

33
import os
4+
import re
45
import subprocess
56
from pathlib import Path
67
from typing import Annotated
@@ -408,7 +409,19 @@ def dev_check(
408409
capture_output=True,
409410
text=True,
410411
)
412+
413+
# basedpyright may return non-zero exit code even for warnings only
414+
# we need to parse the output to check for actual errors
415+
has_errors = False
411416
if result.returncode != 0:
417+
# look for the summary line like "X errors, Y warnings, Z notes"
418+
for line in result.stdout.splitlines():
419+
match = re.search(r"(\d+)\s+errors?", line)
420+
if match and int(match.group(1)) > 0:
421+
has_errors = True
422+
break
423+
424+
if has_errors:
412425
console.print("[red]❌ Pyright found errors, errors provided below[/]")
413426
for line in result.stdout.splitlines():
414427
console.print(f"[red]{line}[/red]")

0 commit comments

Comments
 (0)