Skip to content

Check for rich formatting being enabled / disabled on a formatter #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mda590
Copy link

@mda590 mda590 commented Mar 24, 2025

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.

@CLAassistant
Copy link

CLAassistant commented Mar 24, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants