You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: preserve stderr output when stdout is not empty during check runs #97
In becwright.engine._run_check, the engine captures and processes stdout/stderr of check subprocesses using a short-circuiting logical or:
output=proc.stdout.strip() orproc.stderr.strip()
If a check command prints standard logging or status to stdout but writes error tracebacks, linter warning details, or debug messages to stderr, proc.stderr is silently ignored and discarded. As a result, the developer sees that the commit is blocked (from the non-zero exit code), but has no error detail in the output since it was printed to stderr.
Steps to Reproduce
Define a rule that calls a custom script.
Make the custom script print to both standard output and standard error:
importsysprint("Initializing check...")
print("Error: division by zero! Traceback...", file=sys.stderr)
sys.exit(1)
Run becwright check.
Observe that the check blocks, but ONLY prints Initializing check.... The error message is completely lost.
Proposed Fix
Modify src/becwright/engine.py to concatenate both stdout and stderr outputs if they are present, rather than discarding stderr:
Activity