ward icon indicating copy to clipboard operation
ward copied to clipboard

Colour output when running on CI platforms that support it

Open darrenburns opened this issue 3 years ago • 1 comments

GitHub Actions supports colour terminal output, but Rich disables it when it detects it's not writing to a terminal.

We should check environment variables, and if we're on a CI platform that we know supports colours, force Rich to write them as described here: https://github.com/willmcgugan/rich/issues/52#issuecomment-624521401

We can detect that we're running on GitHub Actions by looking at the env var described in here: https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables

We should also allow the user to force colour output by passing a command line flag.

Example of output in our CI pipeline just now:

image

darrenburns avatar May 30 '21 17:05 darrenburns

Hi @darrenburns, I can work on this issue if no one else has. I'm comfortable with Python and have used ward before, but haven't contributed much to open source projects, so I thought I would try to help with this.

ImAKappa avatar Jul 05 '22 23:07 ImAKappa