krr icon indicating copy to clipboard operation
krr copied to clipboard

Check for rich formatting being enabled / disabled on a formatter

Open mda590 opened this issue 8 months ago • 1 comments

We have a use case for a custom CSV formatter, and when I use it, I am running into an issue with line-wrapping causing the CSV to not render correctly. So it seems like when I set rich_console=False when setting up a custom formatter, that should disable the console.print function. This fixes the issue I was having when writing the CSV.

This PR enables using the value of rich_console in a formatter's decorator to specify whether to write a file directly or using Console to print, and converts the settings.format conditional to a more Pythonic approach.

mda590 avatar Mar 24 '25 10:03 mda590

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 24 '25 10:03 CLAassistant