Keep pyqasm validate diagnostics on one line - #405
Conversation
Rich wraps console output at the detected width (80 when stdout is not a tty). A file path longer than that was broken mid-token across lines, so the reported path was neither copyable nor clickable, and the two CLI tests asserting the absolute path failed whenever the repository sat at a long enough filesystem path. The error console now uses soft_wrap, which disables wrapping and cropping while leaving markup intact. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Argus reviewAuto-review is off for this repo. Tick the box below to run a review on this PR.
Estimated cost
Tip: you can also comment |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesValidation diagnostics
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This change keeps validation diagnostics, including long file paths, on a single line without affecting the reported error content; the supplied verification shows the targeted tests and full suite pass, so no actionable merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Merging as the |
Problem
pyqasm validatebuilds its output with a defaultrich.Console, which wraps at the detected console width (80 when stdout is not a tty). A file path longer than that is broken mid-token across lines:The reported path is then neither copyable nor clickable in a terminal.
The same wrapping breaks two CLI tests, which assert the absolute path appears in the output:
tests/cli/test_cli_commands.py::test_validate_qasm_with_invalid_filetests/cli/test_cli_commands.py::test_validate_command_with_invalid_fileThey pass in CI only because the runner checks out to a short path (
/home/runner/work/pyqasm/pyqasm). They fail for any contributor whose clone sits at a longer path, which is why they showed up as "pre-existing failures" while reviewing #402, #403 and #404.Fix
The error console now uses
soft_wrap=True, which disables wrapping and cropping while leaving markup intact — one diagnostic per line, path unbroken.Verification
tests/cliat a short path and at a path long enough to trigger the old wrap:Full suite at the long path: 802 passed, 3 skipped.
pylint10.00/10,blackandisortclean.Summary by CodeRabbit
pyqasm validatediagnostics so long file paths remain intact instead of splitting across terminal lines.