Conversation
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis pull request introduces target-aware rendering capabilities to the coloured text library. A new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
This PR adds an explicit writer-aware rendering path to
colored_textwithout changing existingDisplayand.to_string()behavior.It introduces
RenderTargetandStyledText::render(...)so callers can makeColorMode::Autofollow stdout, stderr, or a caller-supplied terminal capability. The existing formatting path remains stdout-based for compatibility.The PR also updates rustdoc and README examples, removes the completed writer-aware item from
TODO.md, and adds targeted tests for stdout/stderr/custom-target rendering behavior and regression coverage around the preservedDisplaysemantics.Notes
This intentionally does not redesign global color configuration or change the default rendering behavior. It is a focused additive API for callers that know their real output target.
Summary by CodeRabbit
Release Notes
New Features
ColorMode::Autoto evaluate terminal capability based on the output destination (stdout, stderr, or explicit terminal setting).render()method enabling explicit control over colour rendering decisions for different output targets.Documentation