File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 11"""Dev commands for the apx CLI."""
22
33import os
4+ import re
45import subprocess
56from pathlib import Path
67from 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]" )
You can’t perform that action at this time.
0 commit comments