Retain colored output in `mdtest` failures
Summary
Rather than using the "no-color" feature, we can use anstream to strip the color codes, as we do in uv.
Closes https://github.com/astral-sh/ruff/issues/13939.
ruff-ecosystem results
Linter (stable)
✅ ecosystem check detected no linter changes.
Linter (preview)
✅ ecosystem check detected no linter changes.
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
I think this is the right approach but I don't have a suggestion for fixing the non-printable characters, so unless folks want to merge I'd likely just close this for now.
If we do that, we'll still need a separate solution for red-knot diagnostics which are more disparate (or we'd have to use anstream over there).
If we do that, we'll still need a separate solution for red-knot diagnostics which are more disparate (or we'd have to use anstream over there).
That's correct. Ideally we would have less code that implements some sort of a diagnostic system and instead have a single one where we do all the color handling. Either way. I think both systems could use the same approach. We define a stylesheet somewhere and pass that through.
I suggest that we revisit this issue after we have the new diagnostic system in place.
Sounds good.