White text in output is invisible
When using a light theme in terminal, the white text is invisible:
I suggest removing unnecessary text coloring, that way in black terminal it will already be white by default, but also white terminal will be usable.
If you agree with the proposed change, I can create a PR.
Oh yes agreed, yes please to a pr!
I've done some investigation. Turns out that the issue is deeper, than I thought initially.
First, it seems to bee present only on Windows. Second, it's actually an issue with click's ~~style~~ echo function implementation. I didn't find another way to circumvent it, other than setting bold font manually:
print(f"\033[1m{text}\033[0m")
# upd. or using:
print(click.style(text, bold=True))
This way it works fine.
How we should address this?
I have opened an issue at click's repo: pallets/click#2985
Seems that we won't be getting a fix from click soon. They've scheduled colorama removal, but that will happen only at click 9.0.0. (see pallets/click#2986).
We have two options now:
- just sit and wait for click 9.0.0 to release, which will automatically solve the problem (will take about half a year);
- still wait for click 9.0.0, but for now, make a little patch to the ClickPrinter: use print(click.style()) instead of click.secho(). This, however, requires testing on various platforms and terminals to ensure that everything will work as expected.
What do you think?
Option 2. sounds like a reasonable workaround, if you feel like making a PR. I am fairly relaxed about testing. I tried it locally on my Mac and things worked as expected.
A third option would be to provide a command line argument to lint-imports for disabling styling and color.
What do you think is best?
A third option would be to provide a command line argument to lint-imports for disabling styling and color.
I don't think it'll be very convenient to use. In the end, this bug can be countered by simply highlighting text in terminal. My opinion is that typing a flag like --nocolor is easier and more convenient, than pressing Ctrl+A to see the text)
Option 2. sounds like a reasonable workaround, if you feel like making a PR.
Yeah, I'll create a PR soon.