ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Retain colored output in `mdtest` failures

Open charliermarsh opened this issue 1 year ago • 2 comments

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.

charliermarsh avatar Oct 29 '24 01:10 charliermarsh

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.

github-actions[bot] avatar Oct 29 '24 01:10 github-actions[bot]

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.

charliermarsh avatar Oct 29 '24 12:10 charliermarsh

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).

charliermarsh avatar Oct 30 '24 02:10 charliermarsh

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.

MichaReiser avatar Oct 30 '24 07:10 MichaReiser

I suggest that we revisit this issue after we have the new diagnostic system in place.

MichaReiser avatar Nov 12 '24 11:11 MichaReiser

Sounds good.

charliermarsh avatar Nov 12 '24 21:11 charliermarsh