How to avoid highlighting operators? #846
-
I am printing a report line like below and one side effect of using rich is that the parentheses become highlighted, when in that case I would not want it to happen, as it does not make the test easier to read. On the same time I do want to keep the highlight of the numbers as this is useful: console_stderr.print(
f"Finished with {failures} failure(s), {warnings} warning(s) "
f"on {len(result.files)} files."
) Is that an easy way to avoid that? In fact I am even wondering if it would not be better to always use plurals and avoid the parentheses, with the risk of upsetting few grammar cops. PS. I would want to avoid implementing a pluralize function. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You could create a custom highlighter, based on ReprHighlighter. i.e. copy it and remove the braces regex. See the second listing here for how to use it. |
Beta Was this translation helpful? Give feedback.
You could create a custom highlighter, based on ReprHighlighter. i.e. copy it and remove the braces regex. See the second listing here for how to use it.