Description:
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() or proc.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:
import sys
print("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:
outputs = [proc.stdout.strip(), proc.stderr.strip()]
output = "\n".join(o for o in outputs if o).strip()
Description:
In
becwright.engine._run_check, the engine captures and processes stdout/stderr of check subprocesses using a short-circuiting logicalor:If a check command prints standard logging or status to
stdoutbut writes error tracebacks, linter warning details, or debug messages tostderr,proc.stderris 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 tostderr.Steps to Reproduce
becwright check.Initializing check.... The error message is completely lost.Proposed Fix
Modify
src/becwright/engine.pyto concatenate bothstdoutandstderroutputs if they are present, rather than discardingstderr: